Real-time feature extractor implementation

조회 수: 1 (최근 30일)
Saad CHAHBA
Saad CHAHBA 2021년 8월 25일
답변: Sahil Jain 2021년 8월 31일
Dear Matlab users,
I would like to process a signal in real time, the signal is provided by another block on simulink, the type of processing I want used by applying the following formula:
%% Input : Ia a vector of n*1
%% Output : Sa a vector of ne*1
l = length(Ia);
Unrecognized function or variable 'Ia'.
N = 1000; %% Number of samples
ne = (l-mod(l,N))/N; %% Number of iterations to balance Ia
n1 = 0;
for i = 1:ne
a = 0;
for j = n1+1:n1+N-mod(l,N)
a = Ia(j) +a;
end
n1 = n1+N;
Sa(i) = a;
end

답변 (1개)

Sahil Jain
Sahil Jain 2021년 8월 31일
Hi Saad. You can use a MATLAB Function block in Simulink which performs the custom processing you want. The following articles may help you further with this.
  1. Implementing MATLAB Functions Using Blocks
  2. Creating Custom Functionality Using MATLAB Function Block

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by