필터 지우기
필터 지우기

Problem with a 3-D bar graph

조회 수: 2 (최근 30일)
Camilla
Camilla 2012년 2월 25일
편집: James Tursa 2013년 10월 25일
This is my code, where DRG is a vector:
drg_u=unique(DRG) for j=1:length(drg_u) indexdrg=find(strcmp(DRG,drg_u{j})); frequenza(j)=length(indexdrg); end
X=1:length(drg_u) Y=(frequenza./length(DRG))*100 bar3(X,Y)
can you please explain to me why the 3-D graph doesn't work? Than you so much =)
  댓글 수: 1
the cyclist
the cyclist 2012년 2월 25일
It would be helpful if you could use the Code button to format your code more readably.

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

답변 (2개)

the cyclist
the cyclist 2012년 2월 25일
Inside your find() command, you use
drg_u{j}
with curly brackets. Instead, you should use parentheses there
drg_u(j)
I don't know if that is the only problem with your code, but it runs to completion if I make that change.

Camilla
Camilla 2012년 2월 25일
I'm pretty sure that those curly brackets are correct! because my DRG vector is a cell!
  댓글 수: 1
the cyclist
the cyclist 2012년 2월 25일
Oh, ok. Can you be more specific about two things? What exactly is DRG? A single vector in a cell? What size vector?etc.
Also, when you say it "doesn't work", what exactly do you mean?

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

카테고리

Help CenterFile Exchange에서 Bar Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by