下面一个例子怎么计算?希望高手帮忙!我是小虾!大家出主意!
<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">>> syms x %<BR>>> A=;</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> A=0?应该是A的行列式等于0吧?<BR>矩阵等于0是所有元素等于0。<BR>解方程用solve就可以,你自己再想想吧[我想你可能没表达出你的意思] 方法1<BR>syms x <BR>A=;<BR>s=solve('det(A)=0','x')<BR><BR>??? Error using ==> solve<BR>'det(A)=0' is not a valid expression or equation.<BR>方法2<BR> syms x <BR>A=;<BR>s=det(A)<BR>solve('s=0','x')<BR> <BR>s =<BR> <BR>x-1<BR> <BR>??? Error using ==> solve<BR>方法3<BR>> syms x <BR>A=;<BR>det(A)<BR>f=solve(det(A))<BR> <BR>ans =<BR> <BR>x^2-1<BR> <BR> <BR>f =<BR> <BR><BR>[ -1]<BR>Error, (in fsolve) s, is in the equation, and is not solved for<BR>方法3基本可以解决!<BR>不知道还有方法没????<BR><BR> 感谢zjliu的提醒!
页:
[1]