声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1105|回复: 3

下面一个例子怎么计算?希望高手帮忙!我是小虾!大家出主意!

[复制链接]
发表于 2006-4-16 13:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<P >例子:定义<FONT face="Times New Roman">x</FONT>为变量,然后用<FONT face="Times New Roman">x,</FONT>定义一个矩阵<FONT face="Times New Roman">A,</FONT>怎么计算<FONT face="Times New Roman">A=0</FONT>,来计算<FONT face="Times New Roman">x</FONT>的值。<p></p></P>
<P ><FONT face="Times New Roman">&gt;&gt; syms x             %<BR>&gt;&gt; A=[x 1; 1  1];</FONT>    <FONT face="Times New Roman">%</FONT>这里只定义一个<FONT face="Times New Roman">2</FONT>阶矩阵<p></p></P>
<P >下面怎么编!!!????帮忙呀!!出来<FONT face="Times New Roman">x</FONT>??<FONT face="Times New Roman">/<BR>怎样编好呀?</FONT></P>
回复
分享到:

使用道具 举报

发表于 2006-4-16 18:31 | 显示全部楼层
A=0?应该是A的行列式等于0吧?<BR>矩阵等于0是所有元素等于0。<BR>解方程用solve就可以,你自己再想想吧[我想你可能没表达出你的意思]
 楼主| 发表于 2006-4-17 12:47 | 显示全部楼层
方法1<BR>syms x             <BR>A=[x 1; 1  1];<BR>s=solve('det(A)=0','x')<BR><BR>??? Error using ==&gt; solve<BR>'det(A)=0' is not a valid expression or equation.<BR>方法2<BR> syms x             <BR>A=[x 1; 1  1];<BR>s=det(A)<BR>solve('s=0','x')<BR> <BR>s =<BR> <BR>x-1<BR> <BR>??? Error using ==&gt; solve<BR>方法3<BR>&gt; syms x             <BR>A=[x^2 1; 1  1];<BR>det(A)<BR>f=solve(det(A))<BR> <BR>ans =<BR> <BR>x^2-1<BR> <BR> <BR>f =<BR> <BR>[  1]<BR>[ -1]<BR>Error, (in fsolve) s, is in the equation, and is not solved for<BR>方法3基本可以解决!<BR>不知道还有方法没????<BR><BR>
 楼主| 发表于 2006-4-17 12:50 | 显示全部楼层
感谢zjliu的提醒!
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-10-4 21:16 , Processed in 0.051844 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表