필터 지우기
필터 지우기

Why does my function not return a figure when there is no error but when there is it returns a figure?

조회 수: 1 (최근 30일)
So i want a function to give me date (value: 1x1 table) as an output and a figure (polarhistogram), but when the function doesnt give an error i wont get a figure. Only when i type some random function with some random variables inside of that function it gives a figure as an output but after that my whole script stops.
So how do i get this line of code below as an output in a figure?
figure
h = polarhistogram (deg2rad(x),deg2rad(y));
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
When simpely demanding h as an output i get this message:
handle to deleted Histogram
The only sections needed to run are 1, 3, 9
But i want this as an output of my function:
Btw windrichtingen means winddirections in dutch.
  댓글 수: 7
Dirk te Brake
Dirk te Brake 2022년 1월 14일
Thanks for all the effort but i found out what the problem was. I plotted another graph without creating a new figure so my polarhistogram disappeard. So only when i created an error I could see the polarhistogram.

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

답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 13일
편집: Walter Roberson 2022년 1월 13일
Change
h = polarhistogram (deg2rad(x),deg2rad(y);
to
h = polarhistogram(deg2rad(x), deg2rad(y));

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by