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.
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
その他の回答 (1 件)
Andrei Bobrov
2013 年 4 月 15 日
編集済み: Andrei Bobrov
2013 年 4 月 15 日
k = [0 1 3 0];
[j1,j1] = histc(t,[-inf,0,(1:2)-eps(100),inf]);
z = (k(j1)*x).^3;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!