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

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 3 Nov 2015

Edited:

on 4 Nov 2015

Community Treasure Hunt

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

Start Hunting!