フィルターのクリア

Problem by importing data into simulink as "Array From Workspace"

9 ビュー (過去 30 日間)
Anna B.
Anna B. 2023 年 7 月 12 日
回答済み: Nils Hornik 2023 年 7 月 13 日
invalid workspace variable specified as workspace input in 'power_controlcurr/Array From Workspace'. Time values must be non-decreasing.
  3 件のコメント
Anna B.
Anna B. 2023 年 7 月 13 日
yes, i have already checked it, the dt is always constant and t i not decreasing.
Harald
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
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 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by