WHY DO I GET THIS ERROR USING THE ERROR BAR AND PLOT?
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
Hello,
does anyone know why I get this error: "Input arguments must be numeric, datetime, duration or categorical"?
Thank you.
댓글 수: 1
Jan1989 seems to have strings and Var2,Var4 and Var5 seem to be NaNs
채택된 답변
Star Strider
2021년 7월 21일
The errorbar call should be:
errorbar(x, MODESTAMMEQ.Var5, MODESTAMMEQ.Var4,'.r','MarkerSize',6)
since ‘MODESTAMMEQ.Jan1989’ (that likely threw the error) has to be processed in the regexp and datetime calls to be usable as ‘x’.
However the ‘MODESTA’ table does not exist, so the second plot call does nothing, and substituting:
plot(x,[y, MODESTAMMEQ.Var5]);
gives a very strange result (at least to me).
.
댓글 수: 8
I tried in this way and it works:
load('MODESTA_MMEQ_STAKES');
errorbar(x,MODESTAMMEQ.Var5(:,1),MODESTAMMEQ.Var4(:,1),'.r','MarkerSize',6)
hold on
plot(x,[y, MODESTAMMEQ.Var5(:,1)]);
hold on
But if I go to plot the error bars with different colors, I can't see the "y" and I lose a value (in the plot before I have 15 values while in this one I get 14 values).
errorbar(x(5432:6513,1),MODESTAMMEQ.Var5(5432:6513,1),MODESTAMMEQ.Var4(5432:6513,1),'.r','MarkerSize',6);
hold on
errorbar(x(7639:10569,1),MODESTAMMEQ.Var5(7639:10569,1),MODESTAMMEQ.Var4(7639:10569,1),'.b','MarkerSize',6);
hold on
errorbar(x(10570:11266,1),MODESTAMMEQ.Var5(10570:11266,1),MODESTAMMEQ.Var4(10570:11266,1),'.m','MarkerSize',6);
hold on
plot(x,[y, MODESTAMMEQ.Var5(:,1)],'g');
Thank you!
My pleasure!
All 15 plot for me.
In chronological order (left to right), the first 5 are red, the next 9 are blue, and 1 magenta at 4 Nov 2019, at the far right edge of the plot. These add to 15, so they all plot for me. (It may be difficult to see the magenta one if it plots on the right edge of the plot and overplots the plot border.)
.
But I can't see the y values (trend), but I would like to see them!
I can only see the data with error barr.
Is it the same for you?
I am not certain what you are referring to.
With this code:
figure
hold on
errorbar(x(5432:6513,1),MODESTAMMEQ.Var5(5432:6513,1),MODESTAMMEQ.Var4(5432:6513,1),'.r','MarkerSize',6);
errorbar(x(7639:10569,1),MODESTAMMEQ.Var5(7639:10569,1),MODESTAMMEQ.Var4(7639:10569,1),'.b','MarkerSize',6);
errorbar(x(10570:11265,1),MODESTAMMEQ.Var5(10570:11265,1),MODESTAMMEQ.Var4(10570:11265,1),'.m','MarkerSize',6);
plot(x,[y, MODESTAMMEQ.Var5(:,1)],'g')
hold off
I get this plot:

Everything appears to be there (even though I do not understand the discrepancy between the errorbar plots and the green ‘Var5’ lines).
.
What do you mean?
The green line and all the error bars appear to be present.
I simply do not understand the differences between the blue error bars and the green line, when the others appear to be on the green line, since I do not understand what the plots represent. I assume that they are correct, however.
.
Ah, okay, I got it!
It's correct they are in that way.
Thank you very much for your help!
As always, my pleasure!
.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Annotations에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
