필터 지우기
필터 지우기

How to generate histogram from a given (x,y) dataset?

조회 수: 10 (최근 30일)
ct8
ct8 2022년 9월 21일
편집: ct8 2024년 4월 17일
From a set of x and y values (attached), I am trying to generate a histogram.
histogram(data, nbins, 'Binwidth', 2, 'BinLimits',[0,360], 'DisplayStyle','bar','LineStyle','-','FaceColor',[0.6350 0.0780,0.1840]

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 21일
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1131165/xy.xlsx';
data = readmatrix(filename);
bar(data(:,1), data(:,2))
  댓글 수: 5
ct8
ct8 2022년 9월 29일
The input values are from the .xlsx file.
Walter Roberson
Walter Roberson 2022년 9월 29일
userPrompt = {'Enter the outer diameter', 'Enter the inner diameter', 'Enter the number of color sectors', 'Enter the gray level outside the wheel'};
caUserInput = inputdlg(userPrompt, titleBar, 1, defaultValues);
Unless you have reprogrammed inputdlg(), inputdlg() cannot read from an xlsx file.
Earlier the content of the file was described as being x and y values, not as being inner diameters, outer diameters, and grey levels.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by