Loading structure with Simulink output returns timeseries object error

조회 수: 5 (최근 30일)
I have a structure in a mat file that I want to load as follows,
load('simulation_000003.mat', 'variablesNotUsedInRun')
But I get the error below. The mat file contains output from a Simulink run (see comment below). Other variables in the file load fine except for variablesNotUsedInRun which invokes and crashes timeseries.m . Why is this simple load command failing?
Operands to the || and && operators must be convertible to logical scalar values.
Error in tsdata.datametadata.warnAboutIsTimeFirst (line 88)
if (len>0 && isTimeFirst ~= tsdata.datametadata.isTimeFirst(sizeData,len,interpretSingleRowDataAs3D))
Error in timeseries.loadobj (line 499)
tsdata.datametadata.warnAboutIsTimeFirst(h.isTimeFirst_,size(data),...
88 if (len>0 && isTimeFirst ~= tsdata.datametadata.isTimeFirst(sizeData,len,interpretSingleRowDataAs3D))
(Note len=[] here)
  댓글 수: 1
K E
K E 2012년 4월 16일
Found a workaround but still curious *why* this error occurs. I populate the fields of the structure variablesUsedInRun with many workspace variables. At the time of the error, this included the Simulink outputs logsout, which is in the class Simulink.ModelDataLogs, and varsOut, which is in the class Simulink.WorkspaceVar . If these variables are *not* added to the structure variablesUsedInRun, I have no problem loading the file. Why would they cause the load command to call and crash timeseries.m ?

댓글을 달려면 로그인하십시오.

채택된 답변

Guy Rouleau
Guy Rouleau 2012년 4월 17일
I tried reproducing by saving many variables to a mat-file, including a structure with fields of class Simulink.ModelDataLogs and Simulink.WorkspaceVar and loding it using a command similar to your. I do not receive errors, so there is something I am missing.
What you describe sounds like a bug.
Please contact technical support with reproduction steps to help us investigate.
I am glad that you have a workaround to continue working.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by