How can we write data from mat file to Simulink data dictionary.
조회 수: 8 (최근 30일)
이전 댓글 표시
I am learning MBD. In that I have to initialise many ports and constants with specific name in sldd file. Problem here is that my data is in the xlsx file which I am importing it to workspace and then storing it as .mat file as sldd has only option to read .mat or .m files.
When I do that it throws me message that reads: 0 items were successfully imported.
I have two things to ask:
1) Why no items are successfully imported and
2) what is correct procedure to import data from .mat or .m file to sldd file
Attach here is the xlsx file which has all the names of the port
댓글 수: 3
Jonas
2021년 9월 28일
편집: Jonas
2021년 9월 28일
I have to ask, these signal definitions, for things like 'In8', 'In10', 'Out5', 'Out6'. What are these? Are these signal definitions for the in- and outports of various subsystems in your model?
Why do you want to write all this meta data in an Excel file and then load it into your modeling structure?
답변 (1개)
Yash
2025년 1월 31일 10:54
편집: Yash
2025년 1월 31일 10:54
Hi Akshay,
You can read the excel file as a table using the "readtable" function: https://www.mathworks.com/help/matlab/ref/readtable.html
Once you have the data, you can write a script which can store the data to the sldd programmatically. Kindly refer to the following article for a better understanding: https://www.mathworks.com/help/simulink/ug/store-data-in-dictionary-programmatically.html
Related MATLAB Answer: https://www.mathworks.com/matlabcentral/answers/2079051
Hope this helps!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!