Could someone help me put this in a for loop

15 views (last 30 days)
x1 = raw_data(:,1);
y1 = raw_data(:,2);
x2 = raw_data(:,3);
y2 = raw_data(:,4);
x3 = raw_data(:,5);
y3 = raw_data(:,6);
x4 = raw_data(:,7);
y4 = raw_data(:,8);
x5 = raw_data(:,9);
y5 = raw_data(:,10);
intX = [x1;x2;x3;x4;x5];
intY = [y1;y2;y3;y4;y5];
Thanks!

Accepted Answer

Daniel Shub
Daniel Shub on 10 Oct 2011
This is a frequently asked question:
While it is possible, you generally do not want to do it.
You can create intX by doing
x = raw_data(:, 1:2:10);
y = raw_data(:, 2:2:10);
intX = x(:);
intY = y(:);

More Answers (0)

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!