Defining column vectors for plotting from a single data source

5 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 8 de Dic. de 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 comentarios
Fangjun Jiang
Fangjun Jiang el 8 de Dic. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by