Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2008-10-01
年龄: 38
帖子: 6
声望力: 0 ![]() |
![]()
麻烦问一下,普通的运算结果显示,应该使用那个控件?我添加GUI代码时,这样写:a=str2double(get(handles.a,'string'));
b=str2double(get(handles.b,'string')); guidata(hObject, handles); c=a+b; set(handles.c,'string',c); 以此完成加法功能,但是不对,应该怎样写呢? 另外在GUI中,隐函数作图用ezplot中可不可以?比如我要做(x/a)^2+(y/b)^2-2*(x/a)*(y/b)*cos(c)=sin(c)^2的图像,总是不对,其中a,b,c是随意输入的常数。该怎样完成呢?谢谢了。 |
![]() |
![]() |
![]() |
#2 |
普通会员
注册日期: 2007-08-07
帖子: 64
声望力: 20 ![]() |
![]()
set(handles.c,'string',c);应改为
set(handles.c,'string',num2str(c)); GUI中,隐函数作图用ezplot可以,例如 a=1;b=1;c=1; syms x y ezplot((x/a)^2+(y/b)^2-2*(x/a)*(y/b)*cos(c)-sin(c)^2) |
![]() |
![]() |