how to solve bar Error . Error using bar (line 58) X must be same length as Y.
1 view (last 30 days)
Show older comments
Commented: john karli on 27 Dec 2018
i have this code. last time its work good and but now bar error is shown.
[num,text,raw] = xlsread('Book1.xlsx');
observX = x(1:1000);
nX = length(imageX);
for i = 1:nX
cX = imageX(i);
cntX(i) = sum(observX == cX);
pmfX = cntX/sum(cntX);
title('Marginal PMF Of "O3.1st.Max.Hour"')
xlabel('Image Of O3.1st.Max.Hour')
title('Histogram Of "O3.1st.Max.Hour"');
xlabel('Image Of O3.1st.Max.Hour');
ylabel('Counts of Occurence');
Error using bar (line 58) X must be same length as Y.
KSSV on 27 Dec 2018
x=num(:,2); % or x=num(:,1); %
As you have used
I suspect.....one of the input to bar is empty or NaN...so the error.
More Answers (0)
Find more on Bar Plots 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!