Create an Array/a List of Position

1 次查看(过去 30 天)
Lucas S
Lucas S 2019-6-27
回答: Adam 2019-6-27
Hello ! I have this code where i search Position of input and output of a Model Reference Block:
portPos = get_param('Model Reference Name', 'PortConnectivity');
for element = portPos(:)'
A = element.Position;
%Append Position A to an array
end
And i would like to add every in/out put Position in an array.
The position is a 1x2 double like this :
145 75
145 135
145 195
145 255
145 315
And so i would like to have something like this :
Position_List = [145 75, 145 135, 145 195, 145 255, 145 315]

回答(1 个)

Adam
Adam 2019-6-27
Position_List = reshape( position', 1, [] );

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by