Opened 12 years ago

Closed 12 years ago

#2033 closed defect (fixed)

matrix() operator gives error in frontend

Reported by: Bruno Scaglioni Owned by: Per Östlund
Priority: high Milestone: 1.9.0
Component: Frontend Version: trunk
Keywords: matrix Cc: Francesco Casella, Adrian Pop

Description (last modified by Martin Sjölund)

instantiating the model:

model testEq
parameter Integer M=5;
parameter Real a[M]=zeros(M);
Real b[M,1];
equation 
    b = matrix(a);
end testEq;

gives error during flattening:

Type mismatch in equation {{b[1,1]}, {b[2,1]}, {b[3,1]}, {b[4,1]}, {b[5,1]}}={{a[1]}, {a[2]}, {a[3]}, {a[4]}, {a[5]}} of type Real[5, 1]=Real[5, 1]

Change History (4)

comment:1 by Bruno Scaglioni, 12 years ago

Cc: Adrian Pop added; adrpop Willi Braun removed

comment:2 by Martin Sjölund, 12 years ago

Description: modified (diff)

comment:3 by Per Östlund, 12 years ago

Owner: changed from somebody to Per Östlund
Status: newassigned

comment:4 by Per Östlund, 12 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r15061. In this case it would be more efficient to use b[:,1] = a though.

Note: See TracTickets for help on using tickets.