Compute the integral of a signal from Simulink into Matlab

4 ビュー (過去 30 日間)
Ubaldo Tiberi
Ubaldo Tiberi 2012 年 9 月 9 日
Hi all,
I performed a simulation with Simulink, and I saved the data in the Matlab workspace automatically via a Scope block. Now, I want to compute the integral of this signal in Matlab. To be more clear: imagine that I have a struct Results in the Matlab workspace, such that Results is a saved data from a Simulink Scope block. I want to compute the integral of Results.signals.values over Results.signals.time. How should I do?
Thanks,
Ubaldo
--
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 9 日
what do you mean by : I want to compute the integral of Results.signals.values over Results.signals.time

サインインしてコメントする。

採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 9 月 10 日
Perhaps you need trapz or cumtrapz.

その他の回答 (1 件)

Ubaldo Tiberi
Ubaldo Tiberi 2012 年 9 月 10 日
Imagine that I issue the command
plot(Results.time,Results.signals.values)
what I get is a figure which represents the signal stored into Result.signals.values over the time span stored into Results.time. If I want to compute the integral of such signal over the time span Results.time what should I do?
I hope this description is more clear. :-)
Ubaldo
--

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by