0
votes

i just wrote a m-file with some defined input in which a simulink file is called.

it worked correctly but when I'm going to define a function based on the same m-file ( so i can give multiple inputs to it) it give's me this error :

"" Invalid matrix-format variable specified as workspace input in 'blocks/From Workspace'. The matrix must have two dimensions and at least two columns. Complex signals of any data type and non-double real signals must be in structure format. The first column must contain time values and the remaining columns the data values. ""

but i'm pretty sure that variable has 2 dimension and has twoo coloumns.

i don't have any idea what to do here.

what can i do here ?

1

1 Answers

1
votes

Are you saying the mfile that runs your Simulink simulation works when the mfile is a script, but not when the mfile is a function? If so, this answer may provide some insight. Despite a preference for functions, I use scripts to run Simulink parameter studies - it was just easier to set up.