how to name input variable and plot line?

Data=[0.05 0.04 0
120 1 0
0.14 0.02 0
13.5 1 0
80 2 0
0.0515 0.02 0.114
19.61 2 0.491
28.2 2 0.1217];
t=(K./((PMS.^a)-1)+B)*TMS;
plot(PMS,t);
i have this code that i cant write much more of it here...anyway is there any way i can name each data for example i wanna name 0.05 0.04 0 this(Short I) then i wanna use them on each line of my plot

 Accepted Answer

Data=[0.05 0.04 0
120 1 0
0.14 0.02 0
13.5 1 0
80 2 0
0.0515 0.02 0.114
19.61 2 0.491
28.2 2 0.1217];
names = {'this'
'that'
'the other'
'mirimba'
'basketball'
'wombat'
'cylon'
'jack'
};
scatter3(Data(:,1), Data(:,2), Data(:,3))
text(Data(:,1), Data(:,2), Data(:,3), names)

4 Comments

thank u but im confused here but its not working what does scatter do...i also attached my fig
Data=[0.05 0.04 0
120 1 0
0.14 0.02 0
13.5 1 0
80 2 0
0.0515 0.02 0.114
19.61 2 0.491
28.2 2 0.1217];
names = {'Short Term I'
'Long Term I'
'SI'
'VI'
'EI'
'Moderately'
'VI_'
'EI_'
};
scatter3(Data(:,1), Data(:,2), Data(:,3));
text(Data(:,1), Data(:,2), Data(:,3), names);
K = Data(:,1);
a = Data(:,2);
B = Data(:,3);
TMS = 0.5;
PMS = 1.1:20;
t=(K./((PMS.^a)-1)+B)*TMS;
plot(PMS,t);
Data=[0.05 0.04 0
120 1 0
0.14 0.02 0
13.5 1 0
80 2 0
0.0515 0.02 0.114
19.61 2 0.491
28.2 2 0.1217];
names = {'Short Term I'
'Long Term I'
'SI'
'VI'
'EI'
'Moderately'
'VI_'
'EI_'
};
scatter3(Data(:,1), Data(:,2), Data(:,3));
text(Data(:,1), Data(:,2), Data(:,3), names, 'Interpreter', 'none');
K = Data(:,1);
a = Data(:,2);
B = Data(:,3);
TMS = 0.5;
PMS = 1.1:20;
t=(K./((PMS.^a)-1)+B)*TMS;
figure
plot(PMS, t);
legend(names, 'interpreter', 'none')
u are a gaurdian angel..thank u
PMS = 1.1:20;
Note that is [1.1, 2.1, 3.1, 4.1, 5.1, 6.1, 7.1, 8.1, 9.1, 10.1, 11.1, 12.1, 13.1, 14.1, 15.1, 16.1, 17.1, 18.1, 19.1]
I wonder if you intended
PMS = 1:.1:20;

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Release

R2016b

Community Treasure Hunt

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

Start Hunting!