MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 一个基础的程序问题。。 (https://www.labfans.com/bbs/showthread.php?t=8090)

inuyasha 2009-05-05 11:18

一个基础的程序问题。。
 
=======================原程序======================
function shiyan3
syms x
R=6378;h=600;
H=[51000 71000 128000 370000];
T=[16 24 48 116]*3600;
for i=1:4
a=(h+H(i)+2*R)/2;
c=(H(i)-h)/2;
b=sqrt(a^2-c^2);
f=sqrt(a^2*(sin(x))*2+b^2*(cos(x))^2);
l(i)=2*int(f,x,0,pi);
L(i)=double(l(i));
V(i)=L(i)/T(i);
end
L
V

==========================运行结果========================
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11

L =

1.0e+006 *

0.2408 0.3099 0.5054 1.3286


V =

4.1798 3.5872 2.9246 3.1815

=========================我的问题====================
我用的2009a版的MATLAB。。。
那个warning 所指的问题是什么啊。。。程序应该改哪些部分。。。
谢谢了,,大家。。

inuyasha 2009-05-06 11:55

回复: 一个基础的程序问题。。
 
额 怎么没人给个回答啊,,,高手啊 帮帮忙啊。。。。

TTT_IOU 2009-05-13 21:10

回复: 一个基础的程序问题。。
 
程序正常,能运行的,没错误,09a的和08b的都有问题,我反都试过,有的很基础的就会出错误!!!换个别的版本试试!!!

马特拉并 2009-05-13 22:31

回复: 一个基础的程序问题。。
 
我新手啊,你编得函数能用,调试此程序时貌似这里的x没赋值,是不是啊?

zlmliming 2009-05-13 23:46

回复: 一个基础的程序问题。。
 
[QUOTE=inuyasha;27207]=======================原程序======================
function shiyan3
syms x
R=6378;h=600;
H=[51000 71000 128000 370000];
T=[16 24 48 116]*3600;
for i=1:4
a=(h+H(i)+2*R)/2;
c=(H(i)-h)/2;
b=sqrt(a^2-c^2);
f=sqrt(a^2*(sin(x))*2+b^2*(cos(x))^2);
l(i)=2*int(f,x,0,pi);
L(i)=double(l(i));
V(i)=L(i)/T(i);
end
L
V

==========================运行结果========================
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11
Warning: Explicit integral could not be found.
> In sym.int at 64
In shiyan3 at 11

L =

1.0e+006 *

0.2408 0.3099 0.5054 1.3286


V =

4.1798 3.5872 2.9246 3.1815

=========================我的问题====================
我用的2009a版的MATLAB。。。
那个warning 所指的问题是什么啊。。。程序应该改哪些部分。。。
谢谢了,,大家。。[/QUOTE]
我觉得没有问题,只是精度变了而已,,没有什么大问题的


所有时间均为北京时间。现在的时间是 13:23

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.