www.dftb.net > %%%%%%%%%%%%%%%%%%%%%%% 求mAtlAB高手给我把这个...

%%%%%%%%%%%%%%%%%%%%%%% 求mAtlAB高手给我把这个...

这个是注解

定义一个块(cell)。比如有下面程序 %% 程序块1 %% 程序块2 %% 程序块3 当更改程序块2中的语句时,可以只运行程序块2而无需从头运行至程序结束,这样可以提高设计调试程序时的效率。

两个都是求最小值 %%%%%%%%%%%%求 ObjEmp 最小值(第一个出现的位置) %%%% end加不加都行 GlobalMin=ObjEmp(find(ObjEmp==min(ObjEmp),end)); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GlobalParams=Employed(find(ObjEmp==min(ObjEmp),end...

t=rand(1,100);%%0-1区间 s=rand(1,100);%%0-1区间 x=t+s; y=t.*s; z=exp(t-s); figure,plot3(x,y,z,'.r'); grid on %%%%%%%%%%%%%%%%%%%%%%%%%% >> x=rand(1,300); y=rand(1,300); figure,plot(x,y,'.r') >> n=0; >> for i=1:300 if sqrt((x(i)...

>> format short %%%% MATLAB默认格式,小数显示 >> A =[1 2 ;3 4]; >> B=inv(A) B = -2.0000 1.0000 1.5000 -0.5000 >> format rat %%%%% 转成分数表示 >> B B = -2 1 3/2 -1/2

在Matlab下输入:edit,然后将下面两行百分号之间的内容,复制进去,保存 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function f=f31(x) f=1./[(x-2).^2+0.1]+1./[(x-3).^4+0.01]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 返回...

>> format short %%%% MATLAB默认格式,小数显示 >> A =[1 2 ;3 4]; >> B=inv(A) B = -2.0000 1.0000 1.5000 -0.5000 >> format rat %%%%% 转成分数表示 >> B B = -2 1 3/2 -1/2

clear all k=600; m=65; x(2)=110; x(1)=2.0944*pi/180;%%x(1)要计算它的三角函数值,转化为弧度 I=1:360;%%I的取值应该是角度吧,那把范围扩大 h=75; I1=I*pi/180;%%i换成别的变量,避免和虚数的i混淆 %% r=atan(m/(2*h)); V=k-m/2-x(2)*cos(x(...

function CellValue = hyvalue(CellObject) % HYVALUE Returns the value of a Hysys spreadsheet cell. % hyvalue(CellObject) - CellObject can be a single object...看不懂啊

也是自己找来的,原代码有少许错误,本人都已更正了,调试运行都通过了的。 对于初学者,尤其是还没有编程经验的非常有用的一个文件 遗传算法实例 % 下面举例说明遗传算法 % % 求下列函数的最大值 % % f(x)=10*sin(5x)+7*cos(4x) x∈[0,10] % % ...

网站地图

All rights reserved Powered by www.dftb.net

copyright ©right 2010-2021。
www.dftb.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com