I am trying to make the answers from the for loop I am writing into a matrix, but every time I use the methods on this website matlab has an error.
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Gabrielle Sudilovsky
 el 8 de Ag. de 2017
  
    
    
    
    
    Comentada: Gabrielle Sudilovsky
 el 10 de Ag. de 2017
            The for loop I am using is:
for ii=1:9;
      rheadb=rhead(ii);
      c=dot(m,rheadb);
end
This for loop is within another bigger loop. rhead is already defined as a 1x9 matrix. m is already defined as a 1x1 matrix. I really need help getting all the values from the for loop saved as one variable in a matrix. Right now, matlab is only saving the last loop. Thankyou!
0 comentarios
Respuesta aceptada
  aborghes
      
 el 8 de Ag. de 2017
        Hi Gabrielle, I am assuming the value you want saved is c? if that is the case, you can just change
c=dot(m,rheadb)
to
c(ii)=dot(m,rheadb)
Más respuestas (0)
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!

