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