help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    maha ismail
 el 13 de En. de 2015
  
    
    
    
    
    Comentada: Star Strider
      
      
 el 13 de En. de 2015
            help I need matlab code that multiply each element in each coulmn by a each element in avector with the same length
0 comentarios
Respuesta aceptada
  Star Strider
      
      
 el 13 de En. de 2015
        
      Editada: Star Strider
      
      
 el 13 de En. de 2015
  
      Use bsxfun:
m  = rand(10,5);
v = rand(10,1);
vm = bsxfun(@times, v, m);
Here, ‘m’ is the matrix, ‘v’ is the vector, and ‘vm’ is the element-by-element product of the columns of ‘m’ and column vector ‘v’.
4 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Get Started with MATLAB 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!

