给定具有连接器阵列x的模型,其中未指定其尺寸,例如,
connector con ... end con; model test con x[:]; end test;
如何用特定大小实例化x,例如这样的事情?
test t(x = ?); ... equation connect(t.x[1], a); connect(t.x[2], b); ...
为什么需要未指定尺寸?你可以这样做:
connector con ... end con; model test constant Integer dim = 1; con x[dim]; end test; // usage test(dim = 10); ... equation connect(t.x[1], a); connect(t.x[2], b); ...
1 回答
为什么需要未指定尺寸?你可以这样做: