Problem by importing data into simulink as "Array From Workspace"
20 次查看(过去 30 天)
显示 更早的评论
invalid workspace variable specified as workspace input in 'power_controlcurr/Array From Workspace'. Time values must be non-decreasing.
3 个评论
Harald
2023-7-13
Hi Anna,
it is difficult to tell why Simulink would error because of a variable having to be non-decreasing when you say it is.
If possible, please upload the model and the required data. Both can be trimmed down to what is needed to reproduce the problem.
Best wishes,
Harald
采纳的回答
Nils Hornik
2023-7-13
Hi Anna,
For this Block the "time values must increase monotonically" as stated here in the doc: Load Data Using the From Workspace Block - MATLAB & Simulink (mathworks.com)
In such cases I would reccomend to use the following functions to find out where in a (potentially large) time vector a decrease occurs.
- issorted() to find out if there are non-increasing elements in the vector
- find() e.g.: find(diff(t)<0) to find the effected indecies/lines
Hope that helps,
Nils
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!