Borrar filtros
Borrar filtros

Plotting histogram with user specified count

10 visualizaciones (últimos 30 días)
Ayan Sharma
Ayan Sharma el 12 de Jun. de 2023
Comentada: Ayan Sharma el 14 de Jun. de 2023
I have a csv file that contains the values to be plotted with their respective counts. Unfortunately, Matlab's histogram function does not seem to have such input. Please specify any method

Respuesta aceptada

Image Analyst
Image Analyst el 12 de Jun. de 2023
If the data file is the histogram itself, you can use bar to plot it.
xy = readmatrix(fileName);
x = xy(:, 1); % Bin values;
y = xy(:, 2); % Histogram count values.
% Plot
bar(x, y);
grid on;
xlabel('Bin Value');
ylabel('Count');

Más respuestas (1)

Samay Sagar
Samay Sagar el 12 de Jun. de 2023
You can use the readmatrix function to read csv files. You can plot histogram using the array returned by the readmatrix function.
  2 comentarios
Ayan Sharma
Ayan Sharma el 12 de Jun. de 2023
I am already using it. But how do I plot it
Ayan Sharma
Ayan Sharma el 12 de Jun. de 2023
It should look like this, and I have the Values and No. of samples in the csv file in 2 columns

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by