Writing Code For a Function
Mostrar comentarios más antiguos
i am Writing Code For a Function but error what is needed is control operation
also is there another way to delay the function work until after the system work for 3 sec to avoid the transition as prog wait stop the system only one time
function D = fcn(Vo, Vin, DesiredOutPut ,Di)
%#codegen
if Di == 0
Di = DesiredOutPut/(DesiredOutPut + Vin);
else
Di = D
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=0,i<1
prog::wait(3.0)
i= 2
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if Vo < DesiredOutPut
D = Di + 0.01;
elseif Vo > DesiredOutPut
D = Di - 0.01;
else
D = Di;
end
Respuestas (2)
Mischa Kim
el 19 de Feb. de 2014
Editada: Mischa Kim
el 19 de Feb. de 2014
Shreef, replace
prog::wait(3.0) % unless you are using MuPAD (symbolic)
by
pause(3)
What are you trying to do in the for-loop? At the moment, you enter the loop with i=0, set i=2 and therefore exit the loop right away, since i>1.
shreef
el 20 de Feb. de 2014
0 votos
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
