# How can I edit my graph in state-space-form?

10 views (last 30 days)
Phil Mifka on 2 Aug 2020 at 16:16
Edited: Phil Mifka on 2 Aug 2020 at 16:17
Hey, I am trying to show different damped functions. I used the state-space-form. Now I want to cut off every lines you see in the following image. Therefore, I want to replace the lines with an constant line (also shown in the picture). In the second picture you can see a picture, I was inspired. I tried different things with if-statements, but found no solution. Maybe someone knows a solution and can help me.
I am very new to MATLAB, so im thankful for alle of your help :)
Picture 1: Picture 2: clear;
clc;
k = 800; % Federkonstante [N/m]
b = 580; % Dämpfungskonstante [Ns/m]
m = 296; % Masse [kg]
% Matrix nach State Space Form auftsllen
A = [0 1; -k/m -b/m]; % gut gedämpft
B = [0; 1/m];
C = [1 0];
D = ;
A2 = [0 1; -k/m -((b/3)/m)]; % weniger gedämpft
A3 = [0 1; -k/m -((b/1.4)/m)]; % Überschwingung
opt = stepDataOptions('StepAmplitude', 1); %Einstellung der Sprungfunktion // geht noch net wirklich gut
sys1 = ss(A,B,C,D); % system in state-space-form konverten
step(sys1,'-r'); % step response zeichnen
hold on
sys2 = ss(A2,B,C,D);
step(sys2,'-b')
sys3 = ss(A3,B,C,D);
step(sys3,'-g');