- Read the data e.g. in the preload or start function, "manipulate", and use the from workspace block.
- Modify the data in the .mat file to include another data point with the same value as the last one.
- Use some switch construct to use a constant value once simulation time passed last time point.
control of interpolation-extrapolation of data in the 'from file' block- matlab/simulink 2010a
조회 수: 7 (최근 30일)
이전 댓글 표시
I am using matlab/simulink 2010a. I want to use the 'from file' block and input data into the embedded matlab function. The file is a .mat file with around 1000 time values in the first column and corresponding pressure values in the second column. But the data gets extrapolated. How do I avoid this.
Thanks in advance
댓글 수: 0
답변 (1개)
Titus Edelhofer
2014년 9월 23일
Hi,
I guess upgrading is not an option? Starting with 2010b you can choose whether to hold the last value or extrapolate. There are some workarounds I could think of:
Titus
댓글 수: 2
Titus Edelhofer
2014년 9월 25일
O.k., this explains it. If I understand you correctly, you only have to switch the parameter "Data interpolation within time range:" on the from file block parameters from "Linear interpolation" to "Zero order hold", which does exactly this: keep the output constant until the value changes.
Titus
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!