声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2018|回复: 4

[编程技巧] matlab gui 的.exe里的syms

[复制链接]
发表于 2009-4-11 09:44 | 显示全部楼层 |阅读模式

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

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

x
result(xl,rl);
function result(xl,rl)
syms x y
equ=(x-rl/(1+rl)).^2 + y.^2 -(1/(1+rl)^2);
equ1=(x-1).^2+(y-1/xl).^2-(1/xl)^2';
[x,y]=solve(equ,equ1);
t=x(2,:);m=y(2,:);
plot(double(t),double(m),'r*');
运行警告Warning: Function failed to evaluate on array inputs; vectorizing the function may
speed up its evaluation and avoid the need to loop over array elements.
运行.exe错误???undefined function or method 'syms' for
input arguments of type 'char'
帮帮我吧!!:'(
回复
分享到:

使用道具 举报

发表于 2009-4-11 19:34 | 显示全部楼层
syms x y,你这里定义这个是为了什么?
 楼主| 发表于 2009-4-11 23:45 | 显示全部楼层

matlab gui生成的.exe syms有问题,求帮忙呀

不定义syms x y就会说x,y没有定义啦!

之前的xl,rl为参数一求出值,在界面里运行没问题的,但是一旦生成.exe就说syms不能输入char,怎办呀?:'(

[ 本帖最后由 ChaChing 于 2009-4-12 10:46 编辑 ]
 楼主| 发表于 2009-4-11 23:51 | 显示全部楼层

matlab 符号含参转化问题

xl=0.5;rl=1;
[x,y]=solve('(x-rl/(1+rl))^2 + y^2 -(1/(1+rl)^2)','(x-1)^2+(y-1/xl)^2-(1/xl)^2');
>> t=x(2,:);m=y(2,:);
>> t=double(t)????就有问题啦,我只是想把含参符号转成数值而已!谢谢啦:'(
发表于 2009-4-12 10:18 | 显示全部楼层
xl,rl楼主输入什麽资料? 没数据没得试!

double只针对symbolic constant or constant expression
help vpa

[ 本帖最后由 ChaChing 于 2009-4-12 10:48 编辑 ]

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-22 15:49 , Processed in 0.068658 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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