I need to use tf() function to create multiple step responses
Show older comments

I need to use the tf command to comute a function, then graph it using the step command.
I can do this with a set line, however for the equation seen in the attatchment. I have constant values for m & k, the goal is for the code to subsitute c in as a value starting from 0, solve the equation and take a step of 1, then re-solve the equation. This process will continue until the final desired value of c = 20 is used. For each calculation the values should be saved and then compiled on the step graph. Below is the code I wrote, the numerous hold on was my attempt at getting MATLAB to keep the values, unfortunately it did not work. Thank-you for your help
%% Iteration Calculation for fixed DE (Must Edit in Script for Different DE) %%
iteration = 0; % sets iteration counter to 0 %
hold on
while(iteration <= 20) % starting while loop %
iteration = iteration + 1; % Updating Iteration Counter %
hold on;
for Fs1 = tf([1],[1 iteration 25]); % sets tf to update based on iteration value %
hold on;
end
end
hold on;
%% Graphing Fs1 %%
figure (1)
step(Fs1) % Graphs Fs1 %
Accepted Answer
More Answers (0)
Categories
Find more on Time-Domain Analysis 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!