Not enough input arguments.

1 visualización (últimos 30 días)
GIZEH TRIANA CARDENAS
GIZEH TRIANA CARDENAS el 22 de Nov. de 2018
Comentada: madhan ravi el 23 de Nov. de 2018
------ I have a problem with this code. The code run for Matlab2011 and I have 2014a. It was typed from Matlab book, so the code is right... and This is de code:
function RHz=HRz(theta)
dato=whos('theta');
if strcmp(dato.class','sym')
RHz=[cos(theta), -sin(theta), 0,0;
sin(theta), cos(theta), 0,0;
0,0,1,0;
0,0,0,1];
else digits(3);
RHz=round([vpa(cos(theta),3), vpa(-sin(theta),3),0,0;
vpa(sin(theta),3), vpa(cos(theta),3),0,0;
0,0,1,0;
0,0,0,1]);
end
---------------------Error is:
Error using strcmp
Not enough input arguments.
Error in HRz (line 3)
if strcmp(dato.class,'sym')
  4 comentarios
Walter Roberson
Walter Roberson el 22 de Nov. de 2018
isa(theta, 'sym')
madhan ravi
madhan ravi el 23 de Nov. de 2018
+1 sir Walter

Iniciar sesión para comentar.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 23 de Nov. de 2018
Editada: Cris LaPierre el 23 de Nov. de 2018
The error message suggest dato.class is empty. The trailing ' is not going to help the comparison, but when dato.class has a value, that alone doesn't generate an error message.
What are you passing into the function as theta? The only way I get this error message with this setup is if theta does not exist.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by