matlab subs用法问题

MATLAB中subs问题出错
[问题点数:40分]
MATLAB中subs问题出错
[问题点数:40分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
MATLAB习题答案(清华大学)
下载积分:836
内容提示:MATLAB习题答案(清华大学),matlab,习题,答案,清华大学
文档格式:DOC|
浏览次数:178|
上传日期: 05:09:41|
文档星级:
该用户还上传了这些文档
MATLAB习题答案(清华大学)
官方公共微信Matlab中subs函数 subs(x*y, {x, y}, {[0 1; -1 0], [1 -1; -2 1]})x与y是'*',不是'.*'啊,为什么会得到这个结果ans = 0 -1
这里subs的替换换就是元素替换,没有矩阵替换后执行矩阵运算你要进行矩阵运算可以这样写>> x=sym([0 1;-1 0]);>> y=sym([1 -1;-2 1]);>> x*yans =[ -2,1][ -1,1]
我知道这些,我的问题是为什么会出现这个结果?
subs的替换就是元素替换,就算是带入矩阵也是执行元素运算,subs程序就是这样写的啊
Symbolic substitution.
SUBS(S) replaces all the variables in the symbolic expression S with
values obtained from the calling function, or the MATLAB workspace.
SUBS(S,NEW) replaces the free symbolic variable in S with NEW.
SUBS(S,OLD,NEW) replaces OLD with NEW in the symbolic expression S.
OLD is a symbolic variable, a string representing a variable name, or
a string (quoted) expression. NEW is a symbolic or numeric variable
or expression.
If OLD and NEW are vectors or arrays of the same size, each element
of OLD is replaced by the corresponding element of NEW.
If S and OLD
are scalars and NEW is an array or cell array, the scalars are expanded
to produce an array result.
If NEW is a cell array of numeric matrices,
the substitutions are performed elementwise (i.e., subs(x*y,{x,y},{A,B})
returns A.*B when A and B are numeric).
If SUBS(S,OLD,NEW) does not change S, then SUBS(S,NEW,OLD) is tried.
This provides backwards compatibility with previous versions and
eliminates the need to remember the order of the arguments.
SUBS(S,OLD,NEW,0) does not switch the arguments if S does not change.
Multiple Substitutions:
subs(cos(a)+sin(b),{a,b},[sym('alpha'),2]) or
subs(cos(a)+sin(b),{a,b},{sym('alpha'),2}) returns
cos(alpha)+sin(2)
Scalar Expansion Case:
subs(exp(a*t),'a',-magic(2)) returns
exp(-t), exp(-3*t)]
[ exp(-4*t), exp(-2*t)]
Multiple Scalar Expansion:
subs(x*y,{x,y},{[0 1;-1 0],[1 -1;-2 1]}) returns
为您推荐:
其他类似问题
扫描下载二维码君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
Matlab中subs函数
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口

我要回帖

更多关于 matlab subs用法 的文章

 

随机推荐