Labelling multiple coordinates for later functions

Hi
Im trying to figure out a way to give my data which is a series of 12 different coordinates 'labels' to be able to use thos labels in further functions.
For example i want to label
p1 = [3.61 0.36] as (x1) and (y1)
p2 = [1.51 3.65] as (x2) and (y2)
p3 = [2.69 0.7] as (x3) and (y3)
p4 = [1.98 4.72] as (x4) and (y4)
e.c.t

 采纳的回答

When you say "label", I think you really mean "index". To achieve that, bundle your data into appropriate matrices:
p=[ 3.61 0.36;
1.51 3.65;
2.69 0.7;
1.98 4.72]
x=p(:,1); y=p(:,2);
and now you can do, for example,
>> p(1,:)
ans =
3.6100 0.3600
>> x(3)
ans =
2.6900
>> y(4)
ans =
4.7200

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Axis Labels 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by