How do I loop a fucntion over matrix columns and store the results in a column?
    26 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    lil brain
 el 10 de En. de 2022
  
    
    
    
    
    Comentada: lil brain
 el 11 de En. de 2022
            Hi,
I have an issue writing a while loop correctly. I have a variable (R) with values that are stored in a matrix full of columns and a function (dfaedit), which I would like loop over each of those columns. Each of these loops should produce a result (H) which I would like to store in a seperate matrix column as a list of numerical values.
I was wondering if someone could help me write this while-loop correctly?
Thanks!
0 comentarios
Respuesta aceptada
  Torsten
      
      
 el 10 de En. de 2022
        If R is your matrix:
[m,n] = size(R);
H = zeros(n,1);
for i = 1:n
  r = R(:,i);
  H(i) = dfaedit(r );
end
3 comentarios
  Torsten
      
      
 el 11 de En. de 2022
				And you call this function as
[m,n] = size(R);
H = zeros(n,1);
for i = 1:n
    r = R(:,i);
    H(i) = dfaedit(r,1,1,1);
end
?
And what is dfaedit_2 ?
Más respuestas (0)
Ver también
Categorías
				Más información sobre Creating, Deleting, and Querying Graphics Objects 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!

