How do you get Signal Builder to import a mat file it exported?

22 ビュー (過去 30 日間)
Mark
Mark 2014 年 10 月 20 日
コメント済み: Kevin Bachovchin 2018 年 9 月 19 日
I want to create groups of tests that can be loaded into Signal Builder depending on the feature of the model that that I am testing. I thought I could export the data to the workspace, save as a MAT file and then import it. The export seems to work, but when I try to import it, I get the error:
An error occurred during data format compatibility check.Attempted to access timeVec(1); index out of bounds because numel(timeVec)=0.
I am using 2011B.

採用された回答

Jon Boerner
Jon Boerner 2014 年 10 月 21 日
When you export data from the Signal Builder in R2011b, it exports it as a structure with all kinds of Signal Builder-specific information. Unfortunately, the Signal Builder cannot import that kind of structure.
If you open the doc page for importing with this command, you can see that you need to have a cell array or structure with time to import the data like you want:
>> web([docroot '/toolbox/simulink/ug/f15-109640.html'])
I think the easiest thing to do is:
  1. Copy the Signal Builder to a new model
  2. Connect the Signal Builder output to a To Workspace block
  3. Change the To Workspace block to save a "Structure with time" to the workspace
  4. Save the variable output by the To Workspace block to a MAT-file
  5. Import that MAT-file to the Signal Builder
You could also just modify the variable exported by the Signal Builder, but I think this model approach is a bit easier/straightforward.
  3 件のコメント
Muhammad Taheruzzaman
Muhammad Taheruzzaman 2016 年 1 月 26 日
編集済み: Muhammad Taheruzzaman 2016 年 1 月 26 日
Jon Boerner, but Signal Builder accept excel file, import from excel to signal builder. I tried but it's the error said; mat file does not comply
Kevin Bachovchin
Kevin Bachovchin 2018 年 9 月 19 日
How can you copy the Signal Builder to a new model though? I didn't drag a Signal Builder from the library? I created a signal builder generator by right clicking and going to "Create and Connect Generator" >> "Simulink" >> "Signal Builder", such as in the following link https://www.mathworks.com/help/simulink/ug/signal-and-scope-manager.html Is there any way to be able to copy the signal generator?

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by