-1

I'm trying to to get a step graph from the following code: Someone pls help as this project is time sensitive.

Simulink model Code:

function y = fcn(~)
    tic;
    y = 0
    pause(5);
    y = 1;
    pause(3);
    y = 0;
    pause(5);
    timeVal = toc;
    fprintf("Simulation time: %f",timeVal);
end

But I'm getting a flat line graph in scope. graph in scope I'm always getting the flat line corresponding to the last assigned value. How do I get a plot for all the changes in the value of variable during execution? [P.S this code is based on a project I'm working on and I'm facing the exact issue there] Someone pls help me as this project is time sensitive.

0 Answers0