Input: 2-dimensional Matrix A
Output: Matrix B, having the same dimensions as A, where each element is the class of the corresponding element in A.
e.g. If A(1,1) = double, then B(1,1) = double
My code is as follows:
function B = whatclass(A)[row,col] = size(A);B = [];for ii=1:row for jj=1:col B(ii,jj) = class(A(ii,jj)); endendend
I am getting the error below:
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in integerize (line 6) B(ii,jj) = class(A(ii,jj));
Any thoughts? Help in advance.
Best Answer