HOW TO SAVE MATRIX VALUES IN A DOUBLE FOR LOOP

This is my code, i need to save every value generated in the loop, x_pto is a 1x2701 matrix and x is a 289x31 matrix, what i want to do is subtract X each x_pto and save all the values generated i (East,North,Up) i know they are going to be huge matrix but is for my final proyect i need to know how to save that, Could u help me please????!!
i=1;
for lat=pi/2:-pi/36:-pi/2
for lon=pi:-pi/36:-pi;
East=-sin(lon).*(x-x_pto(:,i))+cos(lon).*(y-y_pto(:,i));
North=-sin(lat).*cos(lon).*(x-x_pto(:,i))-sin(lat).*sin(lon).*(y-y_pto(:,i))+cos(lat).*(z-z_pto(:,i));
Up=cos(lat).*cos(lon).*(x-x_pto(:,i))+cos(lat).*sin(lon).*(y-y_pto(:,i))+sin(lat).*(z-z_pto(:,i));
i=i+1;
end
end

Réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by