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

 채택된 답변

Matt J
Matt J 2020년 8월 19일
편집: Matt J 2020년 8월 19일
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

댓글 수: 3

Thank you ver much for your help
You're welcome, but please Accept-click the answer, if it solved your problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

제품

질문:

2020년 8월 19일

댓글:

2020년 8월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by