How i do my RMS function on Embedded Matlab Function
이전 댓글 표시
Hello.
I need to create my RMS block to use with simulink. This is the first part of a protection relay project. So i'll test many algoritms to do this. I already did this on m-file project but im want to do this a dinamic mode.
I've read about of coder.extrinsic.
Example:
% Mann & Morrison algoritm
f0=60;
w=2*pi*f0;
b=(1/w)^2;
c=1/sqrt(2);
fs=32*f0; % sample frenq. 32 sample per cycle.
dt=1/fs;
der=(I(n) - I(n-2))/(2*dt); %I is a imput (sine wave block)
Ief(n-1)=c*(sqrt(I(n-1)^2 + b*(der)^2)); %Ief is a RMS value at sample n
n=n+1;
I dont know how i work with arrays on the function block. I need a buffer?
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!