simulink data process in batch

1 回表示 (過去 30 日間)
JUNGUK KO
JUNGUK KO 2017 年 6 月 10 日
コメント済み: JUNGUK KO 2017 年 6 月 16 日
I am trying to handle 550000 values in a variable with Simulink. but Simulink computes single value step by step. I need to apply Short time fourier transform to these. How can I calculate these 550000 values at the same step?
error script shows 'Attempted to acces Data_in_x(:,2); index out of bounds because numel(Data_in_x) = 1.'

採用された回答

Vandana Rajan
Vandana Rajan 2017 年 6 月 16 日
Hi,
Let me give you an example solution. I have a Simulink model, which takes input data using 'From Workspace' block, performs FFT on it using FFT block and outputs the results to workspace via 'To Workspace' block.
It is as shown in the figure attached here.
Since 'From Workspace' blocks expect first column of input matrix as time stamps, the columns 2 to 4 contain my data. I have set the sample time in the 'From Workspace' block as 1. In the configuration parameters, I have set the solver as 'fixed-step' with step-size of 1.
Now, when I press the 'step' button in Simulink, it computes FFT of data with time stamp = 0. So, after 1st step, the output is FFT corresponding to x(1,2:end). Now, if I press step again, it gives me FFT corresponding to x(2,2:end) and it continues.
If I had given the entire data as one single column (2nd column, since 1st column is time stamp), then for each step, Simulink will give me FFT for one data point.
HTH,
Vandana Rajan
  1 件のコメント
JUNGUK KO
JUNGUK KO 2017 年 6 月 16 日
Thank you so much, I will try this FFT block on my system :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!