Read in data from an external file during RTW
古いコメントを表示
I'm using RTW to generate a c-code (dll), which is used in ADAMS to simulate the model. I'm using a c code in my Simulink model to read in body parameters from an external file. I would like to read the variabls from an excel file using a .m code. However, I do not want to create a new dll everytime the variables are changed. I want the dll to read the variables everytime I run the simulation, rather than the variable values getting compiled during the code generation. I would appreciate if I could get some help with this.
Thanks.
3 件のコメント
Kaustubha Govind
2012 年 10 月 23 日
Do you intend to write C code to call into Excel as a COM server to read the spreadsheet? If so, perhaps you should replace your existing C code with this?
Walter Roberson
2012 年 10 月 23 日
I would have thought RTW would imply that you were using an operating system other than MS Windows (the only family of operating systems that support COM servers) ?
Sandeep
2013 年 1 月 11 日
採用された回答
その他の回答 (1 件)
Sandeep
2012 年 10 月 24 日
0 投票
2 件のコメント
Walter Roberson
2012 年 10 月 24 日
I have never worked with RTW, but what I have seen of it looked as if it supported standard C buffered I/O routines such as fopen() and fscanf(). If not directly in the modelling language, then due to the fact that it is C and those are standard features of C for all but embedded device purposes.
Sandeep
2013 年 1 月 11 日
カテゴリ
ヘルプ センター および File Exchange で Interactive Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!