Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Using size operator on variable arraysize

Using size operator on variable arraysize

Hi,
I just experienced a problem. I defined an array with a variable size:

Real[:, :] TestArray;
Real TestSize;

And later in die equation (or algorithm) part I assigned the value of the array and then tried to read out the size of TestArray:

algorithm
TestArray := {{11,12,13}; {21,22,23}};
TestSize = size(TestArreay, 1);

When I simulated the value of TestSize was 0 all the time. I wasn't using OpenModelica but Wolfram System Modeler. The question that I have is: Is this behaviour normal? Is the size operator only allowed on arrays with a fixed size? In the official Modelica Spec a couldn't find anything...

Thanks!

There are 0 guests and 0 other users also viewing this topic
You are here: