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

 採用された回答

James Tursa
James Tursa 2017 年 2 月 17 日

0 投票

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]})
James Tursa
James Tursa 2017 年 2 月 17 日
+1 Guillaume

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2017 年 2 月 17 日

編集済み:

2017 年 2 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by