フィルターのクリア

How to poprely implement a matlab function in simulink

1 回表示 (過去 30 日間)
Boleslaw Nadowski
Boleslaw Nadowski 2017 年 1 月 26 日
回答済み: Zoe Xiao 2017 年 8 月 3 日
Hello,
In sumulink, I am trying to create FFT output in two ways: with built-in simulink blocks, and with a Matlab function block (Simulink model attached). While biult-in blocks give a fine output, the function block is creating something I don't understand(also attached), what should I do for the function block to work fine(I need a function block for a much more complicated function later)?
The function code is as follows: function f = fun1(x) f = abs(fft(x)); end

採用された回答

Zoe Xiao
Zoe Xiao 2017 年 8 月 3 日
There is no 'unbuffer' functions in your MATLAB function. So the data on your plot contain fft results calculated at each sample times. You could plot any column corresponding to the simulation time between 150sec and 250sec, which will give you a meaningful spectrum. Or simply add 'unbuffer' block as you did on the other path.
If you still see the unmatching results after you include 'unbuffer' block, please contact the MathWorks technical support.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by