MATLAB: How to store values from loop in an array image processing v=[1 2 3;4 5 6;7 8 9]l2=zeros(3,1)for i=1:3l2=norm(v((i),:),2)end i want to store store l2 values in an array. Best Answer v=[1 2 3;4 5 6;7 8 9] ;l2=zeros(3,1) ;for i=1:3 l2(i) = norm(v((i),:),2) ;endRead about MATLAB matrix indexing..... Related SolutionsMATLAB: Divide elements between 2 matrices M1 =[4 3 6 8 1 10 5 2 9 4 5 6 1 10 3 9 4 2 5 7 6 5 4 3 9 5 1 7 8 10 3 4 2 6 5 1];M2 =[1 6 3 5 3 5 9 6 2 1 9 5];[n,m]=size(M1);a=reshape(M1,n,4,[]);b=bsxfun(@rdivide, a,M2);out=b(:,:) MATLAB: Determine loop which include cellarrays z=[1 2 3;4 5 6;7 8 9];w = cell(3,1);n = cell(3,1);for i=1:3 w{i}=z(:,i); n{i}=w{i}(1,:);end Related QuestionDivide an array in n different arraysHow to enter values into a workspaceProblem with for loopsHow to convert 2X4X10 array into 4x2x10 arrayI want to take different values in each loopMatrix formed by Vectors?Easy question.
Best Answer