labelling elements in an array

1 view (last 30 days)
kunderhill16
kunderhill16 on 25 Aug 2016
Edited: Azzi Abdelmalek on 25 Aug 2016
I have a matrix G with
labelsG = {'Delusions','Hallucinations','Flattened','Inappropriate','Poverty','Thought'};
I have performed constrained PCA and a rotation to get a new variable, Predictor_weights. Each element of Predictor_weights is how much a given column of G (symptom) can predict variation in another matrix (Z).
I took the four most extreme values of Predictor_weights, and called this new variable absmax_Predictor_weights.
[~, index] = sort(abs(Predictor_weights), 'descend');
absmax_Predictor_weights = Predictor_weights(sub2ind(size(Predictor_weights), index(1:4, :), repmat(1:size(Predictor_weights, 2), 4, 1)));
MY QUESTION:
How can I assign my labels of G to the numeric elements of absmax_Predictor_weights? Each numeric element of absmax_Predictor_weights relates to a column of G.
Hope that makes sense, and thank you!

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!