how to write a matlab prog. for the exp. z(t)=y^3 where y=x when 0<=t<=1 ; y=3*x when 1<t<=2.
Afficher commentaires plus anciens
expression : z(t)=y^3
where y=x when 0<=t<=1
y=3*x when 1<t<=2
how to write a matlab program for this expression?
i guess if condition can be used, but exactly how to write ?
3 commentaires
Azzi Abdelmalek
le 15 Avr 2013
Is y a function of t or x?
ravishankar
le 15 Avr 2013
Yao Li
le 15 Avr 2013
Is x another input argument?
Réponse acceptée
Plus de réponses (1)
Andrei Bobrov
le 15 Avr 2013
Modifié(e) : Andrei Bobrov
le 15 Avr 2013
k = [0 1 3 0];
[j1,j1] = histc(t,[-inf,0,(1:2)-eps(100),inf]);
z = (k(j1)*x).^3;
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!