Too many output arguments using histogram function
조회 수: 7 (최근 30일)
이전 댓글 표시
got a script from someone to calculate SO2 flux from volcanoes using satellite data.
%matS5Pdetect is a matrix (npixel x 14)
matS5Pdetect=[lon1(sel) lon2(sel) lon4(sel) lon3(sel) lat1(sel) lat2(sel) lat4(sel) lat3(sel) SO2VCD(sel) lon5(sel) lat5(sel) secs(sel) row(sel) SO2SCDcor(sel)];
% 1 2 3 4 5 6 7 8 9 10 11 12 13 14
[a, b]=histogram(matS5Pdetect(:,14),50);
[temp, lind]=min(abs(cumsum(a)./sum(a)-0.8));
limitscd=b(lind);% limitscd is the 80 percentile
k=find(matS5Pdetect(:,14)>limitscd); %Based on the 20% largest SO2 slant column, I will estimate a plume direction
if ~isempty(k)
But when I run the code i get this error message:
Error using histogram
Too many output arguments.
Error in S5PSO2_flux_calc_scriptie (line 157)
[a, b]=histogram(matS5Pdetect(:,14),50);
Why does it say too many output arguments? What should i change
댓글 수: 1
Adam Danz
2021년 5월 25일
Welcom to the forum. I've edited your question to format your code. In the future please use the code/text toggle in rich text editor to format your code.
답변 (2개)
Steven Lord
2021년 5월 25일
I think what you're looking for is the histcounts function, whose documentation page shows that the first two outputs (for numeric data) are the bin counts and the vector of edges.
Alternately if you have Statistics and Machine Learning Toolbox available, the prctile function may give you the information you want.
댓글 수: 0
Jan
2021년 5월 25일
The command histogram replies 1 output only.
Unfortunately in your code the outputs are called "a" and "b", such that I cannot guess, what you expect as output. But maybe you mean histcounts instead of histogram.
참고 항목
카테고리
Help Center 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!