sub histogram from histogram
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Manish Sharma
 el 23 de Jun. de 2016
  
    
    
    
    
    Comentada: Muhammad Usman Saleem
      
 el 23 de Jun. de 2016
            i have a = [1,1,1;1,2,3;2,1,4;1,1,3;2,1,2;1,3,2] and i form histogram of matrix "a" by hist(a)
now I want to make histogram of all the columns of matrix"a" separately. how this is performed and what if i have 100x100 matrix then how will this be achieved.
0 comentarios
Respuesta aceptada
  Bjorn Gustavsson
      
 el 23 de Jun. de 2016
        Perhaps something like:
for i1 = 1:size(a,2)
  [H1{i1},H2{i1}] = hist(a(:,i1));
end
stairs(H2{2},H1{2})
hold on
stairs(H2{1},H1{1},'g')  
stairs(H2{3},H1{3},'r')
You should presumably look into using a second argument to hist but that you'd decide better than I guess...
HTH
2 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Histograms en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


