Matlab 版 (精华区)

发信人: seesea (马虎学究), 信区: Matlab
标  题: [合集]请问:怎样关掉MATLAB中的警告信息?
发信站: 哈工大紫丁香 (2003年01月16日15:55:58 星期四), 站内信件


────────────────────────────────────────
 hitchy (枫)                          于 2003年01月10日16:01:50 星期五 说道:

我编了几行程序,但运行时总出现一堆的警告
怎么样才能关掉这些警告,不显示它
我刚开始学MATLAB,还望各位多多指!不胜感激!

────────────────────────────────────────
 zjliu (秋天的萝卜)                   于 2003年01月10日16:04:01 星期五 说道:

是程序有问题,改正后就好了(不会出现警告了)
【 在 hitchy (枫) 的大作中提到: 】
: 我编了几行程序,但运行时总出现一堆的警告
: 怎么样才能关掉这些警告,不显示它
: 我刚开始学MATLAB,还望各位多多指!不胜感激!

────────────────────────────────────────
 jq (冰城唐三藏)                      于 2003年01月10日16:39:16 星期五 说道:

warning off
【 在 hitchy (枫) 的大作中提到: 】
: 我编了几行程序,但运行时总出现一堆的警告
: 怎么样才能关掉这些警告,不显示它
: 我刚开始学MATLAB,还望各位多多指!不胜感激!

────────────────────────────────────────
 hitchy (枫)                          于 2003年01月10日20:47:24 星期五 说道:

谢谢!我也知道可能是程序有问题
不过我实在是菜鸟一个,刚开始学MATLAB
我是用FSOLVE函数求解一个非线性方程
结果运行后出现下列警告信息
Optimization terminated successfully:
 Relative function value changing by less than OPTIONS.TolFun
Warning: Cannot determine from calling sequence whether to use new
  (2.0 or later) FSOLVE function or grandfathered FSOLVE function.
  Assuming new syntax; if call was grandfathered FSOLVE syntax, 
  this may give unexpected results.
  To force new syntax and avoid warning, add options structure argument:
      x = fsolve(@sin,3,optimset('fsolve'));
  To force grandfathered syntax and avoid warning, add options array argument:
      x = fsolve(@sin,3,foptions);
我看不懂,不知道问题出在哪里,能帮我看一下吗
多谢了!
【 在 zjliu (秋天的萝卜) 的大作中提到: 】
: 是程序有问题,改正后就好了(不会出现警告了)
: 【 在 hitchy (枫) 的大作中提到: 】
: : 我编了几行程序,但运行时总出现一堆的警告
: : 怎么样才能关掉这些警告,不显示它
: : 我刚开始学MATLAB,还望各位多多指!不胜感激!

────────────────────────────────────────
 hitchy (枫)                          于 2003年01月10日20:48:17 星期五 说道:

谢谢!
【 在 jq (冰城唐三藏) 的大作中提到: 】
: warning off
: 【 在 hitchy (枫) 的大作中提到: 】
: : 我编了几行程序,但运行时总出现一堆的警告
: : 怎么样才能关掉这些警告,不显示它
: : 我刚开始学MATLAB,还望各位多多指!不胜感激!

────────────────────────────────────────
 zjliu (秋天的萝卜)                   于 2003年01月10日20:52:15 星期五 说道:

贴出你的程序可以么
【 在 hitchy (枫) 的大作中提到: 】
: 谢谢!我也知道可能是程序有问题
: 不过我实在是菜鸟一个,刚开始学MATLAB
: 我是用FSOLVE函数求解一个非线性方程
: 结果运行后出现下列警告信息
: Optimization terminated successfully:
:  Relative function value changing by less than OPTIONS.TolFun
: Warning: Cannot determine from calling sequence whether to use new
:   (2.0 or later) FSOLVE function or grandfathered FSOLVE function.
:   Assuming new syntax; if call was grandfathered FSOLVE syntax, 
:   this may give unexpected results.
:   To force new syntax and avoid warning, add options structure argument:

────────────────────────────────────────
 able (随心所欲)                      于 2003年01月10日21:03:03 星期五 说道:

warning off 
做一个鸵鸟,遇到事情的时候把头放在沙子里面....Haha...
肯定没有好好上课,或者很不认真
【 在 hitchy (枫) 的大作中提到: 】
: 谢谢!我也知道可能是程序有问题
: 不过我实在是菜鸟一个,刚开始学MATLAB
: 我是用FSOLVE函数求解一个非线性方程
: 结果运行后出现下列警告信息
: Optimization terminated successfully:
:  Relative function value changing by less than OPTIONS.TolFun
: Warning: Cannot determine from calling sequence whether to use new
:   (2.0 or later) FSOLVE function or grandfathered FSOLVE function.
:   Assuming new syntax; if call was grandfathered FSOLVE syntax, 
:   this may give unexpected results.
:   To force new syntax and avoid warning, add options structure argument:

────────────────────────────────────────
 hitchy (枫)                          于 2003年01月10日21:29:01 星期五 说道:

我的程序:
global x
y0=0:0.1:2*pi;
z=zeros(1,length(y0));
for i=1:length(y0) 
    x=y0(i);
    z(i)=fsolve('c',y0(i));
end
plot(y0,z)
其中函数c为:function c=c(y)
global x
c=100*(cos(x)-cos(y))-5*(1-cos(x)*cos(y)+sin(x)*siny));

────────────────────────────────────────
 zjliu (秋天的萝卜)                   于 2003年01月10日22:04:54 星期五 说道:

你注意一下,这里y是c的参数,不能用它作为fsolve
命令的输入参数
【 在 hitchy (枫) 的大作中提到: 】
: 我的程序:
: global x
: y0=0:0.1:2*pi;
: z=zeros(1,length(y0));
: for i=1:length(y0) 
:     x=y0(i);
:     z(i)=fsolve('c',y0(i));
: end
: plot(y0,z)
: 其中函数c为:function c=c(y)
: global x

────────────────────────────────────────
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.974毫秒