马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
我用了solve求解了方程组,想在第一个程序方程组的解带入下个方程组去求解,但是我用的subs怎么不能带入!
程序如下:
clear;clc;close all;
x1=0;y1=0;z1=0;x2=0;y2=192.1;z2=0;z3=0;
[x3,y3]=solve('x3^2+y3^2=158.2^2','x3^2+(y3-192.1)^2=158.2^2');
a=x3;
b=y3;
%a = double(a);
%b = double(b);
for i=1:2
[x4,y4,z4]=solve('x4^2+y4^2+z4^2=396.5^2','x4^2+(y4-192.1)^2+z4^2=396.0^2',...
'(x4-x3(i))^2+(y4-y3(i))^2+z4^2=365.0^2');
end
for i =1:2
x4(i)=subs(x4(i),{'x3(i)','y3(i)'},{a(I),b(i)});
end
执行错误如下:
??? Error using ==> eval
Undefined command/function 'x3'.
Error in ==> sym.double at 45
D = reshape(eval(X),siz);
Error in ==> sym.subs at 66
if isempty(vars), NEWf = double(OLDf); return, end
Error in ==> coordinatechange_exe at 15
x4(i)=subs(x4(i),{'x3(i)','y3(i)'},{a(i),b(i)});
[ 本帖最后由 Billow 于 2008-12-28 15:38 编辑 ] |