Embedded Matlab Function - Output for every calculation
Mostrar comentarios más antiguos
Good day to all!
I have some simple code:
function Pr = fcn(unused)
%#eml
k = 100;
Pr = 180;
for i = 1:k
x = Pr * 0.05;
y = Pr - x;
Pr = y;
Pr;
if (Pr == 0 || Pr < 0)
Pr = 180;
end
end
Intention here is simple: Decrease the value of Pr until equal to or less than zero and reset. Concurrently, see the rise and fall of the same on scope. But all i get is a single constant output(as shown in the pic).

WHERE AM I GOING WRONG?
Please let me know!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Texas Instruments C2000 Processors en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!