From: alepana Panariti on 13 Apr 2010 06:37 Hello! I have a problem. I have created a bus to be used in a simulink model which contains a stateflow diagram. elem = Simulink.BusElement; elem.Name ='myMatrix'; elem.DataType = 'int32'; elem.Dimensions = [10 10]; newBus = Simulink.Bus; newBus.HeaderFile = 'structure.h'; newBus.Name = 'myBus'; newBus.Elements = elem; assignin('base', 'myBus', newBus); I have specified a C header file: 'structure.h'; The structure.h is: typedef struct { int myMatrix[10][10]; } myBus; When I start the simulation this error occurs: Error c3_myModel.c: 202 operands of = have illegal types `array 10 of int' and `int' Error c3_myModel.c: 202 lvalue required The error line is: 201. for (c3_i3 = 0; c3_i3 < 100; c3_i3 = c3_i3 + 1) { 202. chartInstance.c3_State.myMatrix[c3_i3] = 0; 203. } Why does matlab try to initialize myMatrix as a vector, instead of as a matrix? I can see two solutions: 1) Set Matlab to not initialize myMatrix. 2) Set Matlab to see myMatrix as a matrix rather than a vector. Can somebody help me?
|
Pages: 1 Prev: how to set fontsize in matlab linux Next: Property/value pairs in class constructors |