basic code question

2 views (last 30 days)
John
John on 22 Mar 2012
Hello,
Say I have a vector 'data' with 2 columns.
What would be the code to set x = to the first column and y equal to the second column?
Kind Regards
John

Accepted Answer

Walter Roberson
Walter Roberson on 22 Mar 2012
x = data(:,1);
y = data(:,2);

More Answers (0)

Categories

Find more on Get Started with MATLAB 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!