MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]matlab的变量批量带入问题 (https://www.labfans.com/bbs/showthread.php?t=4915)

endlich 2008-10-19 20:19

[求助]matlab的变量批量带入问题
 
例如a=diff(exp(-t))
求t=0,1,2,3,4,5,7时a的值改写程序,令x=[0,1,2,3,4,5,7];
我不想用循环语句,有什么便捷的方式搞定?

meteora1005 2008-10-19 21:39

回复: [求助]matlab的变量批量带入问题
 
不太明白你的意思,再说清楚些。

endlich 2008-10-19 23:27

回复: [求助]matlab的变量批量带入问题
 
就是用一个语句输出a(1)-a(7)
aa=subs(a,'t',x)
行不行

meteora1005 2008-10-19 23:45

回复: [求助]matlab的变量批量带入问题
 
:ft: 还是不明白,你的句子就可以运行啊,a只有6个元素啊
t=[0,1,2,3,4,5,7];
a=diff(exp(-t))
a =
-0.6321 -0.2325 -0.0855 -0.0315 -0.0116 -0.0058


所有时间均为北京时间。现在的时间是 03:18

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.