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

 采纳的回答

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

2 个评论

or
validateattributes(x, {'numeric'}, {'size', [3 4]})
+1 Guillaume

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Parallel Computing Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by