Matrix with element that change with 'for loop'
Matrix with element that change with 'for loop'
(OP)
Hello every body
I am working on a project that I need to find matrix similar to this one
% Beginning of the Code
clear all;close all;clc;
for m=1:10
A11(m)=m+1;
B11(m)=2*m;
D11(m)=2*m+1;
abd=[A11(m) B11(m);B11(m) D11(m)];
end
%End of the Code
where I want the matrix 'abd' get different value for each value of 'm' ,in the code above I only get the value at m=10;and if I use abd(m) it won't be right since in that form it just indicates the element.so please help and suggestions.
I am working on a project that I need to find matrix similar to this one
% Beginning of the Code
clear all;close all;clc;
for m=1:10
A11(m)=m+1;
B11(m)=2*m;
D11(m)=2*m+1;
abd=[A11(m) B11(m);B11(m) D11(m)];
end
%End of the Code
where I want the matrix 'abd' get different value for each value of 'm' ,in the code above I only get the value at m=10;and if I use abd(m) it won't be right since in that form it just indicates the element.so please help and suggestions.
RE: Matrix with element that change with 'for loop'
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Matrix with element that change with 'for loop'