what I have to do to solve the error "Invalid or deleted object." while creation of histogram?

6 Ansichten (letzte 30 Tage)
I created a Histogram of the wav file :
[n, fs] = audioread('host.wav');
h = histogram(n);
then histogram has plotted and its porperties were displayed like as follows:
h =
Histogram with properties:
Data: [62747×1 double]
Values: [1×205 double]
NumBins: 205
BinEdges: [1×206 double]
BinWidth: 100
BinLimits: [-9300 11200]
Normalization: 'count'
FaceColor: 'auto'
EdgeColor: [0 0 0]
When i tried to access the poperties of this histogram like
h.NumBins();
it gives an error as given below:
Invalid or deleted object.
Error in matlab.graphics.chart.primitive.Histogram/get.BinEdges
Error in matlab.graphics.chart.primitive.Histogram/get.NumBins
How to resolve this issue? Thanks in Advance
  3 Kommentare
Dennis
Dennis am 5 Mär. 2019
Did you close the figure?
Are you using a script or functions?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

KSSV
KSSV am 5 Mär. 2019
Dont close the figure.....if you close the figure obviously you will get this error.
  5 Kommentare
Walter Roberson
Walter Roberson am 5 Mär. 2019
So call histogram again . Make it invisible if you want. You can create a figure just for this purpose .
Steven Lord
Steven Lord am 5 Mär. 2019
Call histogram a second time to recreate the histogram object.
h = histogram(n);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by