声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 917|回复: 2

[编程技巧] 关于solve命令的问题

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

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

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

x
新手求助,现编了一个循环程序,里面用到solve函数,但循环只进行了一步,就提示出错!??? Error using ==> solve at 162
Unable to find closed form solution 。先将程序列于下方,请高人指教!谢谢
主程序
clc
clear

Down_standard = -2;
Up_standard = 2;

for i=1:4
miu_standard = 0;
theda_standard = double(fun_norm(Down_standard,Up_standard));

Up_standard = norminv(0.9772,miu_standard,theda_standard);
Down_standard = norminv(0.0228,miu_standard,theda_standard);
end
子程序
function y= fun_norm(a,b)
syms t theda
y = solve(int(exp(-t^2/(2*theda^2))/(theda*(2*pi)^0.5),t,a,b)-1);

我个人认为这个程序的问题在于如何在循环体里求积分,似乎我给的积分只能积一次,不能循环,请大师们指教!
回复
分享到:

使用道具 举报

发表于 2009-8-5 11:03 | 显示全部楼层
个人水平专业有限, LZ的问题不是很深入了解, 但直觉好像使用数值解的方式即可! 请LZ自行考量下!
发表于 2009-8-5 14:39 | 显示全部楼层

回复 楼主 yxhhit 的帖子

??? Error using ==> solve at 162 Unable to find closed form solution
出错提示应该是solve不能给出解析解,参考数值解法,help fsolve
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-10-1 03:22 , Processed in 0.057627 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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