24小时热门版块排行榜    

查看: 666  |  回复: 7
当前主题已经存档。
【有奖交流】积极回复本帖子,参与交流,就有机会分得作者 yatlan 的 4 个金币
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

yatlan

新虫 (初入文坛)

[交流] 【求助】matlab 求解方程组时 出错,非常急,好心人帮忙!

clear;
syms  a b c d e cl cz ll lz cll lll czl lzl;
a=ll*lz*cl*cz;
b=ll*cl+lz*cz+lz*cl;
c=ll*lz*cl;
d=lz;
e=(b+(b^2-4*a)^(1/2))/2;
cll=(a*(a-e^2))/(e*(a*d-c*e))-3.071;
lll=(a*d-c*e)/(a-e^2)-7.533;
czl=(a-e^2)/(c-d*e)-1.313;
lzl=(e*(c-d*e))/(a-e^2)-3.222;
solve(cll,lll,czl,lzl);

如上的程序在最后solve 求解时提示
??? Error using ==> subsref
Index exceeds matrix dimensions.

Error in ==> sym.subsref at 16
  y = builtin('subsref',struct(x),a);

Error in ==> solve at 191
      S.(char(symvars(j))) = R(:,j);

再线等................!  
非常感谢
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yatlan

新虫 (初入文坛)

。。。。。。。。。。。。。。。。
如果是没有解析解的话,我如何给出数值解呢?
8楼2009-10-03 21:08:37
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 8 个回答

bote

sorry for some confusiion?

★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
sunxiao(金币+2,VIP+0):thank you for your suggestions 10-3 00:13
1. seems using solve(cll,lll,czl,lzl, 'cz', 'cl', 'lz', 'll')

have tried a simple case like what you are going to do. it works.
the code is as follows:

clear;
clc;
syms a u v;
l=a*u^2 + v^2;
m=u-v-1;
n=a^2-5*a+6;
A=solve(l,m,n, 'a','u','v');

therefore, it seems that your equations are too complicated for the matlab. maybe, the other approaches had to be considered, such as simplify your equations first.
anyway, show it up here if you solve the problem. good luck.

again: if you remove only one denominator from any one of your four equations, the code can run through to the end after replacing the solve function with the one given above. so, you had to simplify your equations first.

[ Last edited by bote on 2009-10-2 at 12:27 ]
2楼2009-10-02 06:28:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

buffalo7239

至尊木虫 (著名写手)

★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
sunxiao(金币+2,VIP+0):谢谢参与,欢迎常来 10-3 00:13
我帮你运行了一下,我的MATLAB7.0没有出错,仅出现警告,可能你的版本过低。结果如下:
Warning: Explicit solution could not be found.
> In solve at 140
  In sym.solve at 49
  In Untitled at 12
3楼2009-10-02 08:23:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

buffalo7239

至尊木虫 (著名写手)

★ ★
sunxiao(金币+2,VIP+0):谢谢参与,欢迎常来 10-3 00:15
你的思想是干嘛,说清楚,解出来的结果,abcde跟你写的一样。如:
a =

ll*lz*cl*cz
4楼2009-10-02 08:26:56
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 据悉今年马上要出结果了 +5 瞬息宇宙 2026-08-10 6/300 2026-08-10 10:38 by Tide man
[基金申请] 2026国自然放榜时间 +7 布布和一二 2026-08-08 7/350 2026-08-10 10:26 by allmydream
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] 关于代码变化问题,想知道的进来 +15 且听虎啸 2026-08-07 22/1100 2026-08-09 22:13 by 布布和一二
[基金申请] 这样的filecode谁见过 +10 布布和一二 2026-08-08 21/1050 2026-08-09 17:21 by 天神眷顾
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[考博] 【2027博士申请】纳米药物递送方向 20+3 13586093586 2026-08-03 5/250 2026-08-08 21:54 by 13586093586
[基金申请] 基金中了 +14 laoda193707 2026-08-06 14/700 2026-08-08 00:23 by 实验小白ha
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 听说今天filecode变了 +24 布布和一二 2026-08-06 47/2350 2026-08-07 16:02 by zhiyanjiang
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +9 archvillain 2026-08-04 11/550 2026-08-05 20:06 by wlwhappy
[基金申请] 有没有H口的?有收到消息的吗? +3 超级海虾 2026-08-04 3/150 2026-08-04 17:26 by 学教育滴
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
信息提示
请填处理意见