php中文网 | cnphp.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 318|回复: 0

工频半波积分m语言计算函数

[复制链接]

2615

主题

2622

帖子

9281

积分

管理员

Rank: 9Rank: 9Rank: 9

UID
1
威望
0
积分
6544
贡献
0
注册时间
2021-4-14
最后登录
2024-4-19
在线时间
665 小时
QQ
发表于 2022-9-4 08:01:06 | 显示全部楼层 |阅读模式
[mw_shl_code=applescript,true]function integ_rsl=halfWaveInt(A)
%实现半波积分矩形算法,输入为任意矩阵,每行为每一通道,每列为每一时刻采样值
%输出有效值
[integ_r,integ_c]=size(A);
integ_rsl=zeros(integ_r,integ_c);

start_flag=1;
point_N=20;
half_pos=19;
for kk=1:integ_r
    for ii=start_flag:integ_c
        if ii<point_N
            for jj=1:ii
                integ_rsl(kk,ii)=integ_rsl(kk,ii)+abs(A(kk,jj));
            end
        else
            for jj=ii-half_pos:ii
                integ_rsl(kk,ii)=integ_rsl(kk,ii)+abs(A(kk,jj));
            end
        end
        
    end
   
end

integ_rsl=integ_rsl*pi*0.025/sqrt(2);


end
[/mw_shl_code]





上一篇:日志定时清理脚本
下一篇:C++实现树链剖分
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|php中文网 | cnphp.com ( 赣ICP备2021002321号-2 )51LA统计

GMT+8, 2024-4-19 21:49 , Processed in 0.174878 second(s), 37 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

申明:本站所有资源皆搜集自网络,相关版权归版权持有人所有,如有侵权,请电邮(fiorkn@foxmail.com)告之,本站会尽快删除。

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