Read data from spreadsheet in Simulink
조회 수: 1(최근 30일)
표시 이전 댓글
Xu Cheng 2018년 11월 27일
답변: Arunkumar M 2018년 11월 28일
First of all, I cannot copy and paste my message to this field and I have to re-type what I have already done some where else. What a pain!
The Matlab/Simulink document states "The From Spreadsheet block interprets the first column as time. ...."
Say my spreadsheet file has its first column as time stamp. The entire time range is 10 hour, and the time step is 1 hour apart (i.e., I have 10 rows of data in total). So the two questions are:
(1) In the Simulink "simulation time" entry field near the top toolbar, what number do I have to enter? what if I enter a smaller number than 10 hour? In this case will the simulation still run 10 hours regardless what simulation time I put in?
(2) How many points will Matlab/Simulink interpret between two adjacent time stamps (currently 1 hour apart) ?
Arunkumar M 2018년 11월 28일
(1) Simulation time entry field is in seconds. If you set simulation time less than 10hours(36000s) say 5000s then simulation stops at 5000s. Only the data till 5000s would have been used by the simulaton.
(2) By default, matlab interpolates data inbetween. Time step is defined by the solver. If you use fixed step solver, then you have the option to define your time step in Model Configuration.
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!