Create a Matlab Function that averages the input signal with the simulation running in the Simulink -- No upload to workspace

조회 수: 3 (최근 30일)
I need to build a matlab function that is able to average the input signal over a specific time period.
In the signal below for example, I need the matlab function to calculate the average of the signal only in the time period from 0.05 to 0.07 s.
I cannot use the send to workspace feature (using to file or to workspace), I need to do this operation while the Simulink model is running.
I cannot use this send-to-workspace feature as it will be implemented physically.
I'm a beginner and I don't know how to start

채택된 답변

Raghava S N
Raghava S N 2023년 6월 13일
편집: Raghava S N 2023년 6월 13일
Hi,
Without knowing your harware target, this is the basic idea you need to implement.
The one-stop solution however is the mean block. This can be reset on a rising or falling edge. If you can extract the timestamp and trigger the mean block, you can implement the solution. What is the hardware target? Based on that the Simulink model can be designed.

추가 답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by