24小时热门版块排行榜    

查看: 665  |  回复: 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的回帖

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的回帖
查看全部 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

至尊木虫 (著名写手)

★ ★
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的回帖

yatlan

新虫 (初入文坛)

1.其实这是一个电路的变换.[ll,lz,cl,cz] 是我最终要求出来的结果, a,b,c,d,e是中间变量 ,cll,lll,czl,lzl是已知的方程表达式,我利用matlab 将中间变量带入到最终方程中.即使 我没有加入中间变量,就是利用最终方程求解a,c,d,e,在我这里一样提示同样的错误.
2.我用的是matlab 2008b,难道这个版本有问题吗?
5楼2009-10-02 10:46:28
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 据悉今年马上要出结果了 +5 瞬息宇宙 2026-08-10 6/300 2026-08-10 10:38 by Tide man
[基金申请] 应该是93bebmhtak前后十一个字符比较关键 +9 Lanmanbaby 2026-08-09 17/850 2026-08-10 10:35 by Tide man
[基金申请] 2026国自然放榜时间 +7 布布和一二 2026-08-08 7/350 2026-08-10 10:26 by allmydream
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +7 yufeiwaner 2026-08-09 7/350 2026-08-10 09:08 by zju2000
[基金申请] 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
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 好奇怪的filecode +3 布布和一二 2026-08-08 4/200 2026-08-08 17:46 by zhanghaozhu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 娱乐 +6 Tide man 2026-08-03 6/300 2026-08-07 22:40 by 铁帽子农民
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +9 archvillain 2026-08-04 11/550 2026-08-05 20:06 by wlwhappy
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
[基金申请] 有没有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
信息提示
请填处理意见