Force get 3*4 matrix
3 views (last 30 days)
Show older comments
Hello, I want force user input exactly 3*4 matrix. other size is unacceptable.
0 Comments
Accepted Answer
James Tursa
on 17 Feb 2017
x = the user input
if( ~isequal(size(x),[3 4]) )
error('Size must be exactly 3x4')
end
2 Comments
Guillaume
on 17 Feb 2017
Edited: James Tursa
on 17 Feb 2017
or
validateattributes(x, {'numeric'}, {'size', [3 4]})
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!