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.
显示 更早的评论
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 个评论
Azzi Abdelmalek
2013-4-15
Is y a function of t or x?
ravishankar
2013-4-15
Yao Li
2013-4-15
Is x another input argument?
采纳的回答
更多回答(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;
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!