How to let 2 vector row to multiply by itself
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
hi I want vector m to multiply with n but for some reason I got this 
input(4,7)
i =
     4     5     6     7
output =
    16    25    36    49
this is my code
function output=input(m,n)
    i=m:n
   output=i.*i
end
6 comentarios
  madhan ravi
      
      
 el 17 de Sept. de 2020
				? Doesn’t prod() do what you want? Or your ”homework” requires a loop?
Respuestas (1)
  madhan ravi
      
      
 el 17 de Sept. de 2020
        
      Editada: madhan ravi
      
      
 el 17 de Sept. de 2020
  
       m = 4;
 n = 7;
 prod(m : n)
Ver también
Categorías
				Más información sobre Loops and Conditional Statements 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!


