i am using from workspae in simulink..i have to load 1by4096 vector,but i am getting 1by4095 ,i am missing first element.what should i do to get that one?
이전 댓글 표시
i am using from workspae in simulink..i have to load 1by4096 vector,but i am getting 1by4095 ,i am missing first element.what should i do to get that one?
답변 (1개)
Walter Roberson
2017년 6월 14일
0 개 추천
When you use From Workspace or From File to load arrays, then the first column is always interpreted as the timestamp. To avoid this you need to use the timeseries or struct input possibilities so you can supply the time information.
댓글 수: 4
bharat yadav
2017년 6월 14일
Walter Roberson
2017년 6월 14일
If you look at https://www.mathworks.com/help/simulink/slref/fromworkspace.html#btm3mv9-1 then notice it creates an extra column for the time. In your case since you have data for only one time, you could use 0 as the time.
Dillan
2024년 3월 29일
As Walter said, you should use a separate column for the time. Please see this doc page for loading array data into the simulation using the "From Workspace" block: https://www.mathworks.com/help/simulink/ug/load-data-using-the-from-workspace-block.html#:~:text=Input%20Data.-,Load%20Array%20Data,-You%20can%20use
The issue is that you need 1 column of time values, and 1 column of data values for the simulator to behave as expected.
Christoph Aistleitner
2024년 5월 2일
If the values are constant and not time dependent, you could just use the Constant block.
카테고리
도움말 센터 및 File Exchange에서 Signal Attributes and Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!