If I have
A1 =
1.0e-013 *
Columns 1 through 8
0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574
Column 9
0.1465
And
A2 =
1.0e-013 *
Columns 1 through 8
0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523
Column 9
0.1465
How can I plot either variables, on the same bar plot?
bar([A1 A2])
legend('A1,'A2')
If MATLAB said:
Warning: Ignoring extra legend entries.
> In legend at 278
What's the mistake?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 31일
편집: Azzi Abdelmalek 2014년 1월 31일

0 개 추천

A1 =1.0e-013 *[ 0.1481 0.1574 0.1465 0.1481 0.1574 0.1465 0.1481 0.1574]
A2= 1.0e-013 *[0.1250 0.1523 0.1465 0.1250 0.1523 0.1465 0.1250 0.1523]
bar([A1' A2'])
legend('A1','A2')

댓글 수: 6

Francesco
Francesco 2014년 1월 31일
If there are so many elements in A1 and A2 and, a priori, I don't Know how many elements, how can I do it?
Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 31일
What do you mean by so many element? give an example
Francesco
Francesco 2014년 1월 31일
The A1 and A2 variables are define before in the code. In this case A1 is 1x9 double and also A2. But it may be 1xn double for A1 and A2. If A1=A2=1xn, I can't do as you said because I have not entire into the code.
Azzi Abdelmalek
Azzi Abdelmalek 2014년 1월 31일
(I have not entire into the code): This sentence is not clear for me
Francesco
Francesco 2014년 1월 31일
But If I have A1 and A2 variables, for example, A1=A2=1*n how I can do the bar plot?
The same as the above answer
bar([A1' A2'])
legend('A1','A2')

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

추가 답변 (0개)

카테고리

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

태그

질문:

2014년 1월 31일

댓글:

2014년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by