in the code below I want to see the plot has the names of all the cases of "0.1 to 1" each line indicates case; feature (0.1), feature (0.2) and so on till feature (1.0).
L =0.1:0.1:1.0;
tot=numel(L);
for i=1:tot
plot(x+i,y+i,'Color');
nam{i} = sprintf('feaures (%d)',i);

 채택된 답변

Birdman
Birdman 2018년 1월 22일

0 개 추천

L =0.1:0.1:1.0;
tot=numel(L);
hold on;
for i=1:tot
plot(x+i,y+i,'Color');
nam{i} = sprintf('feaures (%d)',i);
end

댓글 수: 4

Najiya Omar
Najiya Omar 2018년 1월 22일
편집: Najiya Omar 2018년 1월 22일
I want to see "feature 0.1" and "feature 0.2" as so on, as legend in the plot like this legend(ax1,'Line 1','Line 2','Line 3'), but my plot has 20 cases I cant write all
You would follow what Birdman wrote with
legend(ax1, nam)
Birdman
Birdman 2018년 1월 22일
편집: Birdman 2018년 1월 22일
L =0.1:0.1:1.0;
tot=numel(L);
hold on;
for i=1:tot
plot(x+L(i),y+L(i),'Color');
leg{i}=['feature' num2str(L(i))];
end
legend(leg)
Najiya Omar
Najiya Omar 2018년 1월 22일
편집: Najiya Omar 2018년 1월 22일
@ Birdman perfect 100% thanks!!!!
If I want to skip case like 0.3, 0.7 to be plotted

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

추가 답변 (1개)

Najiya Omar
Najiya Omar 2018년 1월 23일

0 개 추천

If I want to skip some cases like 0.3, 0.7 in the loop iteration and to be plotted

태그

질문:

2018년 1월 22일

답변:

2018년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by