how to create 3D array

3 Ansichten (letzte 30 Tage)
Naga A
Naga A am 30 Okt. 2015
Beantwortet: Stalin Samuel am 30 Okt. 2015
Hi,
I have a matrix which contains the center(x and y coordinates, 10*2 matrix ) of 10 hexagons. I need to create a 3D array such that it stores the hexagon number along with its center. For example
B=[x1,y1,1
x2,y2,2
x3,y3,3
...
x10,y10,10]
I never used 3D arrays and I went to the tutorial and its some what confusing.And, suppose if I want to access only X and Y coordinates of all hexagons and only the number of hexagon,should I use B(1,2,:) and B(:,:,1)?Can you please help me here.

Antworten (1)

Stalin Samuel
Stalin Samuel am 30 Okt. 2015
XY_coordinates = B(:,1:2)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by