How to write a for loop to make the column calculations?
Mostrar comentarios más antiguos
Hi,
I have the data of X and Y as shown in the image

I wrote the for loop as shown here, it is making the calculations for the first column. But, how to make the calculations for the rest of the columns in the same for loop?
for i=1:3
y=[Y1{i,1}']
x=[X{i,1}']
A= fminsearch(@(par_fit) funccoats(par_fit,x,y),rand(1,2));
B(i,1)=A(:,1)
C(i,1)=A(:,2)
end
Thanks
Respuesta aceptada
Más respuestas (1)
Muhammad Usman Saleem
el 24 de Jul. de 2015
0 votos
use another for loop for the calculations over the other columns(Nested for loop).
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!