Renaming columns within the variable editior screen

So I took 4 files of data all with 136 columns of data and combined them into one file. Now they are all in one giant workspace. I would like to create a new variable from each column so I can make plots, etc. How do I go about doing this without manually clicking and creating a new variable from each file? Typically I would just import the excel data and create variable vectors from each column but since I combined files this was not an option.

Respuestas (1)

Steven Lord
Steven Lord el 15 de Mayo de 2018
So you want to create either 136 or 4*136 = 544 individual variables (depending on whether you "combined" them vertically or horizontally)? That's going to clutter your workspace quite a bit. Instead, just use indexing into your combined array or store your data in a table array.
M = magic(5)
plot(M(:, 4))
title('Fourth column of magic')
T = array2table(M)
figure
plot(T.M2)
title('Second column of magic')
figure
plot(T{:, 1})
title('First column of magic')

Categorías

Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 15 de Mayo de 2018

Respondida:

el 15 de Mayo de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by