Defining column vectors for plotting from a single data source

5 次查看(过去 30 天)
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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-12-8
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 个评论
Fangjun Jiang
Fangjun Jiang 2011-12-8
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by