MATLAB: Force get 3*4 matrix

matirx

Hello, I want force user input exactly 3*4 matrix. other size is unacceptable.

Best Answer

x = the user input
if( ~isequal(size(x),[3 4]) )
error('Size must be exactly 3x4')
end