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.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Andrei Bobrov
am 15 Apr. 2013
Bearbeitet: Andrei Bobrov
am 15 Apr. 2013
k = [0 1 3 0];
[j1,j1] = histc(t,[-inf,0,(1:2)-eps(100),inf]);
z = (k(j1)*x).^3;
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!