MATLAB: Without using any matlab built-in program,how can I create a program that tells about the no of rows and column in a matrix

program to determine size of matrix

I think that this program can form by using for loop.Please help

Best Answer

A = rand(10,10) ;
%%Get rows

try
k = 1;
while( true )
A(k,1) ;
k = k + 1;
end
catch
nx = k-1 ;
end
%%Get columns
%%Get rows
try
k = 1;
while( true )
A(1,k) ;
k = k + 1;
end
catch
ny = k-1 ;
end
[nx,ny]