How to plot this function ?

1 visualizzazione (ultimi 30 giorni)
Wasp Hamberg
Wasp Hamberg il 31 Ott 2018
Commentato: Wasp Hamberg il 31 Ott 2018
U(t)={=-t,t=(0,pi/2); = 0, (pi/2,pi)}

Risposta accettata

the cyclist
the cyclist il 31 Ott 2018

Here is one way:

U = @(t) -(t<pi/2).*t + (t>=pi/2) * 0; % Don't really need that second term, since it is always zero
figure
tt = 0:0.01:pi;
plot(tt,U(tt),'.')

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by