I found myself continually typing size(A,1) and size(A,2) to get the number of rows and columns. Finally, I just wrote the (very) simple scripts nrows.m and ncols.m. All they do is call the size command but it makes code easier to read…
[cc lang="matlab"]
>> B = zeros( nrows(A), ncols(A) );
[/cc]
The obvious and simple definitions are:
[cc lang="matlab"]
function [n] = nrows(d)
n = size(d,1);
[/cc]
[cc lang="matlab"]
function [n] = ncols(d)
n = size(d,2);
[/cc]