for loop in simulaink as matlab function

1 view (last 30 days)
Is there any way to use this code as a matlab function in simulink?
P=zeros(0,n+1);
P(1) = P_in;
CR = (P_out/P_in)^(1/(n));
for i = 2:n
P(i) = CR*P(i-1);
P(i+1) = CR*P(i);
end

Answers (0)

Categories

Find more on Startup and Shutdown 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!