Invalid Message ID Format. Is my syntax wrong?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mert Ayduman
el 24 de Oct. de 2016
Respondida: Marc Jakobi
el 24 de Oct. de 2016
function area = areaof3ang(x1,y1,x2,y2,x3,y3)
if nargin~=6
error(message('You need to input 6 values for 3 points. As in x1,y1,x2,y2,x3,y3'));
end
area=abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2))/2)
end
When I deliberately input 2 variable, it shows me this error.
Error using message
Invalid Message ID format: 'You need to input 6 values for 3 points. As in x1,y1,x2,y2,x3,y3'.
Error in areaof3ang (line 3)
error(message('You need to input 6 values for 3 points. As in x1,y1,x2,y2,x3,y3'))
What am I doing wrong?
0 comentarios
Respuesta aceptada
Marc Jakobi
el 24 de Oct. de 2016
You do not need message() for that function.
function area = areaof3ang(x1,y1,x2,y2,x3,y3)
if nargin~=6
% this is sufficient:
error('You need to input 6 values for 3 points. As in x1,y1,x2,y2,x3,y3');
end
area=abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2))/2)
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!