Excel to Simulink real time data streaming

조회 수: 2 (최근 30일)
Nonso
Nonso 2025년 6월 1일
댓글: Walter Roberson 2025년 6월 5일
I need help on how I can stream data of temperature, energy consumption in Excel file into Simulink on real time. This means as you change or enter new value in excel sheet while the Simulink simulation is running, it will be captured as input in Simulink. Thanks in Advance.

채택된 답변

Walter Roberson
Walter Roberson 2025년 6월 1일
편집: Walter Roberson 2025년 6월 1일
In the form you have phrased the question, it must be assumed that a random location inside the data might be updated (as opposed to the case where more data is added at the end.)
As such, we need to understand the excel data as being a data matrix, as opposed to it being timeseries data. Timeseries data would involve processing rows of input data at the time associated with the row, with it not being possible to go back and re-do steps if the data changes for an already-processed time.
You cannot use From Spreadsheet for this purpose. From Spreadsheet is strictly for reading matrix data in timeseries form (that is, there is a time column that indicates when each row is to come into effect.)
I am not sure that there are methods to periodically re-read excel data matrices as pure blocks of data; I cannot think of any at the moment, but I might be overlooking something.
The situation would be different if you are willing to run the simulation under the control of MATLAB, and if all of the simulation is to be done each time. In that situation, you would have the MATLAB level re-read from the excel file, and have the MATLAB level perform set_param() calls to set up block parameters, and then call sim() to run all of the simulation, and then loop back.
  댓글 수: 2
Nonso
Nonso 2025년 6월 5일
@Walter Roberson,thank you for your time and wonderful contribution. I can stream excel dataset now into Simulink, but the excel file has to be read into the workspace first, before streaming. In this case, I cannot manually enter new values in the excel for the Simulation to update itself as it runs i.e real time update. I need something to tie the excel and the Simulink for real time Simulation update. I want Simulink to accept real time input from excel as it runs basically.
Walter Roberson
Walter Roberson 2025년 6월 5일
You are not clear as to whether the excel data represents time-series data or represents a data matrix.
If it represents time-series data, then there is definitely no method that would permit altering data for times that have already been processed.
If it represents a data matrix, then I cannot currently think of any way to stream it into Simulink, but I might have overlooked something.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by