i was trying to run this function below and the Error message i am getting is Error: Function definitions are not permitted in this context. function y=emfg(u) |Can anyone help me out
Show older comments
function y=emfg(u)
if (u>-180)&&(u<=-120)
y=[-1;0;1];
elseif(u>-120)&&(u<=-60)
y=[0;-1;1];
elseif(u>-60)&&(u<=0)
y=[1;-1;0];
elseif(u>0)&&(u<=60)
y=[1;0;-1];
elseif(u>60)&&(u<=120)
y=[0;1;-1];
elseif(u>120)&&(u<=180)
y=[-1;1;0];
end
Answers (1)
Azzi Abdelmalek
on 24 Jun 2015
Edited: Azzi Abdelmalek
on 24 Jun 2015
u=10 % for example
y=emfg(u)
Categories
Find more on Get Started with MATLAB 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!