Blogger news

Saturday, 21 June 2014

Creating NxM matrix using for loop in MATLAB

N=input('number of Row=');
M=input('number of Column=');
X=randi([0,100],N,M)

here 0,100 means the limit of the integer.it can use as variable like as Row and column.now for variable integer the code will be.
N=input('number of Row=');
M=input('number of Column=');
 f=input('Enter the starting limit =');
k= input('Enter the last limit =');
X=randi([f,k],N,M)

No comments:

Post a Comment