Filter löschen
Filter löschen

Error in port widths or dimensions in Flow State

1 Ansicht (letzte 30 Tage)
Josip Strutz
Josip Strutz am 14 Nov. 2015
Beantwortet: Shruti Sapre am 17 Nov. 2015
Hello,
I got an error in in port widths or dimensions in the attached flow state diagramm. It's my first diagramm, please be patient :)
"Output port 1 of 'Problem2/FSM Controller Mode/input events' is a one dimensional vector with 3 elements"

Antworten (1)

Shruti Sapre
Shruti Sapre am 17 Nov. 2015
Hi Josip,
There are two ways to avoid this error, depending if the ports are dynamically sized or not:
1. If the inputs and outputs have constant size, specify the dimensions manually as follows:
block.InputPort(1).Dimensions = 13;
block.InputPort(2).Dimensions = 1;
block.InputPort(3).Dimensions = 1;
block.InputPort(4).Dimensions = [3 8];
2. If the use of dynamically sized inputs/outputs is required, use the SetInpPortDims method as follows
block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims);
block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
function SetInpPortDims(Block, port, dims)
Block.InputPort(port).Dimensions = dims;
If (port == 1)
Block.OutputPort(1).Dimensions = dims;
end
Hope this helps!
-Shruti

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by