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

조회 수: 23 (최근 30일)
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
Dennis
Dennis 2019년 3월 5일
Did you close the figure?
Are you using a script or functions?

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

답변 (1개)

KSSV
KSSV 2019년 3월 5일
Dont close the figure.....if you close the figure obviously you will get this error.
  댓글 수: 5
Walter Roberson
Walter Roberson 2019년 3월 5일
So call histogram again . Make it invisible if you want. You can create a figure just for this purpose .
Steven Lord
Steven Lord 2019년 3월 5일
Call histogram a second time to recreate the histogram object.
h = histogram(n);

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by