# How can i draw the graph of this two functions using matlab

2 vues (au cours des 30 derniers jours)
PULAK Kumer le 19 Déc 2020
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Rik le 19 Déc 2020
You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks).

Connectez-vous pour commenter.

### Réponses (1)

Rafael Hernandez-Walls le 19 Déc 2020
when i have this like problem i use this code:
t=linspace(0,2*pi,50);
f=((t>0)&(t<=1)).*2+((t>1)&(t<=pi/2)).*0.5.*t.^2+((t>pi/2)).*cos(t);
plot(t,f)
##### 2 commentairesAfficher AucuneMasquer Aucune
Rik le 19 Déc 2020
Why did you post a complete solution to a homework question?
I would also use ... to make each piece of this function more distinct:
t=linspace(0,2*pi,50);
f= ((t>0)&(t<=1) ).*2+...
((t>1)&(t<=pi/2)).*0.5.*t.^2+...
((t>pi/2) ).*cos(t);
plot(t,f)
Rafael Hernandez-Walls le 19 Déc 2020
oopps!

Connectez-vous pour commenter.

### Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by