Output argument is not assigned on some execution paths.
Show older comments
Hi,
My simulink function block have this code:
%Este bloco tem como função o ratreamento dos pontos pelos quais o robô
%deve passar e também o cálculo de e_theta, LAC e R TRACKING(e_theta,LAC,D,Stop)
function [e_theta,LAC,D,Stop] = gera_traj(goal,TRAJECTORY,x,y,theta)
% a ideia é para cada pronto ter um if.
aux = 1;
if TRAJECTORY(aux,1) < goal(aux,1)-0.03
Stop = 0;
d1 = (TRAJECTORY(aux,2)-y)/(TRAJECTORY(aux,1)-x);
thetad1= atan(d1);
d2 = (TRAJECTORY(aux,2)-y)/(TRAJECTORY(aux,1)-x);%Confirmar se é esse atg msm
thetad2 = atan(d2);
LAC = abs(thetad1)-abs(thetad2);
D = sqrt((TRAJECTORY(aux,2)-y)^2+(TRAJECTORY(aux,1)-x)^2);
e_theta = thetad1-theta;
else
aux= aux+1;
end
if TRAJECTORY(aux,1) == goal(aux,1)-0.03
Stop = 1;
end
end
And when i run it, i have this problem:
"Output argument 'e_theta' is not assigned on some execution paths."
How Can I fix it? Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!