How to exit a function execution in MATLAB Function block in simulink?
Mostrar comentarios más antiguos
I have simulating the miller-L code in simulink using MATLAB function block. If the program is run for the first time, I want the output to be like this:
if isempty(flag)
flag=1;
con = initial*-1;
h1 = BinaryInput;
if BinaryInput == 1
MillerSignal = [con*ones(1,1) -con*ones(1,1)];
con=con*-1;
else
MillerSignal = [-con*ones(1,2)];
con = con*-1;
end
return;
end
I am not sure whether the return statement is returning out of the function or just from the function block. Is this correct? If not, what is the correct way to do it?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Sources 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!