MATLAB创建m文件后提示to run this file,you can either change the mat
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/10 16:47:16
MATLAB创建m文件后提示to run this file,you can either change the matlab current directory or add...
function [s,phis,k,G,E]=golds(phi,a,b,delta,epsilon)
%功能:0.618法精确线搜索
%输入:phi是目标函数,a,b 是搜索区间的两个端点
% delta,epsilon分别是自变量和函数值的容许误差
%输出:s,phis分别是近似极小点和极小值,G是nx4矩阵,
% 其第k行分别是a,p,q,b的第k次迭代值[ak,pk,qk,bk],
% E=[ds,dphi],分别是s和phis的误差限.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t=(sqrt(5)-1)/2; h=b-a; phia=feval(phi,a); phib=feval(phi,b);
p=a+(1-t)*h; q=a+t*h; phip=feval(phi,p); phiq=feval(phi,q);
k=1; G(k,:)=[a,p,q,b];
while(abs(phib-phia)>epsilon)||(h>delta)
if(phip
function [s,phis,k,G,E]=golds(phi,a,b,delta,epsilon)
%功能:0.618法精确线搜索
%输入:phi是目标函数,a,b 是搜索区间的两个端点
% delta,epsilon分别是自变量和函数值的容许误差
%输出:s,phis分别是近似极小点和极小值,G是nx4矩阵,
% 其第k行分别是a,p,q,b的第k次迭代值[ak,pk,qk,bk],
% E=[ds,dphi],分别是s和phis的误差限.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t=(sqrt(5)-1)/2; h=b-a; phia=feval(phi,a); phib=feval(phi,b);
p=a+(1-t)*h; q=a+t*h; phip=feval(phi,p); phiq=feval(phi,q);
k=1; G(k,:)=[a,p,q,b];
while(abs(phib-phia)>epsilon)||(h>delta)
if(phip
没事的,因为这个函数是你自己定义的,所以所有的参数都会提示未定义.但是当你调用这个函数时不会出现问题的.
MATLAB创建m文件后提示to run this file,you can either change the mat
to run this file,you can either change the matlab current di
matlab创建m文件
请译1:DO YOU WANT TO RUN OR SAVE THIS FILE?2:RUN 3:SAVE
matlab中我运行m文件总是提示File F:\matlab2\work\1.m is not found in th
The past can hurt.But you can either run from it or learn fr
Cydia提示什么i wasnt able to locate this file 什么this meant you n
用matlab的M文件创建一个斐波拉契数列
Matlab中自定义函数如何创建M文件?
用MATLAB创建M文件计算三角形的面积A
If one day,the whole world would change,you can come to my m
Either you or the handmaster______the prizes to this gifted