How can I use the 'From File'-block with simulation targets other than rsim?
古いコメントを表示
In the documentation it says the 'From File'-block is usable with double, one-dimensional, real signals, if using any simulation target other than rsim. I tried it in several simple models, but the data contained in the specified .mat file at compile time is simply hard coded in the generated code. The compiled model will obviously give the same results no matter which data is contained in the specified file.
I know it is generally possible to use for example the C-API to interact with the executable, but it seems a lot of trouble for the simple and available method to provide .mat files.
3 件のコメント
Ryan G
2013 年 2 月 6 日
When you say the data is hard coded, do you mean the name of the file or the data contained in the file?
Patrick
2013 年 2 月 6 日
Ryan G
2013 年 2 月 6 日
Are you trying to generate code for this? I don't think this will work since you would be trying to generate code that reads MAT files which are designed to be used only in MATLAB. When you read simulation target that may mean something like accelerator mode versus normal mode.
If you have xPC there is a generic from file block there that you may be able to work with or you can use input ports and write code to read and write from a file.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulink Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!