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

 Respuesta aceptada

James Tursa
James Tursa el 17 de Feb. de 2017

0 votos

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

2 comentarios

Guillaume
Guillaume el 17 de Feb. de 2017
Editada: James Tursa el 17 de Feb. de 2017
or
validateattributes(x, {'numeric'}, {'size', [3 4]})
James Tursa
James Tursa el 17 de Feb. de 2017
+1 Guillaume

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 17 de Feb. de 2017

Editada:

el 17 de Feb. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by