how to plot graph
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
aditya sahu
el 17 de Jun. de 2017
Respondida: dpb
el 17 de Jun. de 2017
suppose i have a matrix of 512*256 elements ranging from -200 to 200. I need to plot a graph, where the x-axis is the elements of the matrix and y-axis is the frequency(i.e no. of time the value presents in the matrix) of each matrix. Kindly suggests me.
0 comentarios
Respuesta aceptada
dpb
el 17 de Jun. de 2017
u=[-200:200].'; % presume all elements are present
histogram(A(:),[u-0.5;u(end)+0.5]) % histogram with bin centered at integer elements
xlim([-210 210]) % even up white space each end
set(gca,'xtick',u(1):40:u(end)) % not enough room for very many ticks
presuming the values are integers as illustrated.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!