Why does my function not return a figure when there is no error but when there is it returns a figure?
Show older comments
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));
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 Comments
Cris LaPierre
on 13 Jan 2022
It would be much easier to help if you could share your entire function and the code + data you are using to call that function. Please attach them to your post using the paperclip icon.
Dirk te Brake
on 13 Jan 2022
Dirk te Brake
on 13 Jan 2022
Walter Roberson
on 13 Jan 2022
The posted code has
load('WeerdataEnschede2021.mat') %Laad de weerdata die verwerkt en gelezen moet worden.
but WeerdataEnschede2021.mat has not been provided.
Dirk te Brake
on 14 Jan 2022
Walter Roberson
on 14 Jan 2022
Unrecognized function or variable 'FahrenheitToCelcius'.
Dirk te Brake
on 14 Jan 2022
Answers (1)
Walter Roberson
on 13 Jan 2022
Edited: Walter Roberson
on 13 Jan 2022
Change
h = polarhistogram (deg2rad(x),deg2rad(y);
to
h = polarhistogram(deg2rad(x), deg2rad(y));
1 Comment
Dirk te Brake
on 13 Jan 2022
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!