Defining column vectors for plotting from a single data source
5 views (last 30 days)
Show older comments
I'm very new to Matlab and I'm just trying to plot data in the simplest way by importing a spreadsheet of column vectors. When using the workspace GUI to plot the data matlab does not know what columns are X, Y, and Z for instance. How do I define them so I don't have to create a bunch of individual vectors.
Thanks,
Mike
0 Comments
Accepted Answer
Fangjun Jiang
on 8 Dec 2011
I don't know how to choose the column using workspace GUI for plotting, but it should be easy using MATLAB command.
A=magic(10);
figure; plot(A(:,3)); %plot the third column
figure; plot(A(:,1),A(:,5)); % plot using first column as X and 5th column as Y
2 Comments
Fangjun Jiang
on 8 Dec 2011
Okay, now I may be able to make the answer complete.
In workspace window, you need to double click the variable, 'A' in the above example. You'll then see a 10x10 grid like an Excel spread sheet. Then you can select a particular column and press the GUI plot button.
More Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!