array initialization
4 views (last 30 days)
Show older comments
in my code i am taking 125 patches and for each patch i am getting 6 values as output of my process.. i am in need to place the 1st value of al the 125 patches in a single array ,2nd value of al 125 patches in another array ...so on upto 6 values..help me in this
0 Comments
Answers (1)
Walter Roberson
on 2 Oct 2011
numpatches = 125;
valsperpatch = 6;
pvalues = zeros(numpatches,valsperpatch);
for K = 1 : numpatches
....
thesepvals = ... %the 6 outputs of processing patch #K
pvalues(K,:) = thesepvals;
end
pval1 = pvalues(:,1);
pval2 = pvalues(:,2);
pval3 = pvalues(:,3);
pval4 = pvalues(:,4);
pval5 = pvalues(:,5);
pval6 = pvalues(:,6);
You should consider, though, whether you really need them to be in separate variables; perhaps you should just leave them in the pvalues array.
0 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!