Loading a mat file in Simulink for signal reproduction
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to input in my mdl file data with prerecorded signals [2xm] where first line is the time and each of the other lines are the different variables. The data can vary from file to file (values/s, time length, total number of values) and can be rather big (several Mb). I need to be able to change the instant of the played scenario (like at a given moment to chose to continue from the moment T or to restart (T=0). That is why I used a Look up Table Dynamic where I can change the time (x entry) and according to it, the moment of the played scenario.
As constants cannot be of variable size [2xm] and because of some larger files, I thought of using a buffer constant of a fixed [2xM] that can be changed every M steps to the next M values of the mat file. The changing procedure is done by a Matlab Function, but this Mfcn needs the data from the mat file. If the input for the Mfcn is a constant this means I can load the file only once at the beginning of the simulation (initfunction callback of the mdl file). This also makes redundant the use of the buffer. I am searching for a variable size data input for this Mfcn that will run after each M values were outputted.
Ruled out solutions: From workspace or From file (inter/extrapolated values according to current simulation time)
Do you have any idea how to do this properly (without a lot of memory usage as the mdl is used in real time simulation)?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!