首页 > 编程知识 正文

matlab求定积分函数,matlab分段函数求值

时间:2023-05-05 21:54:45 阅读:162371 作者:2484

matlab初学函数腐烂的灰狼

function [ dev ]=get _ deviations [ ws ] #这是一个腐烂的灰狼的函数

x=Length(ws;

sum=0;

for i=1:x

sum=sumws(I;

结束

ave=sum/x;

for i=1:x

dev(I )=ws (I )- ave;

结束

for i=1:x #使用烂灰狼函数

fr intf (enter the wind-speedforturbine % d ),I );

a=input(: );

min=a 1;

secmin=a 1;

if min a

secmin=min;

min=a;

secinnum=minnum;

minnum=j;

j=j 1;

elseif secmin a secmin=a; secinnum=j; j=j 1; endws(I )=a; sum=sum a; 结束

fr intf (theslowestwind-speedisforturbine % dwithaspeedof % dn ),minnum,min ) ) ) ) )。

fr intf (the second-slowest wind-speedisforturbine % dwithaspeedof % dn ),secinnum,secmin ) ) ) ) )。

frintf(thewindspeedsare: ) )

for i=1:x

fprintf () %d ),ws ) I ) )

结束

dev=get_deviations(ws;

frintf(thedeviationsare: ) )

for i=1:x

frintf () %d ),dev ) ) I ) )

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。