Force get 3*4 matrix

1 次查看(过去 30 天)
Dani D
Dani D 2017-2-17
Hello, I want force user input exactly 3*4 matrix. other size is unacceptable.

采纳的回答

James Tursa
James Tursa 2017-2-17
x = the user input
if( ~isequal(size(x),[3 4]) )
error('Size must be exactly 3x4')
end
  2 个评论
Guillaume
Guillaume 2017-2-17
编辑:James Tursa 2017-2-17
or
validateattributes(x, {'numeric'}, {'size', [3 4]})

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by