Renaming columns within the variable editior screen
Show older comments
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.
Answers (1)
Steven Lord
on 15 May 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')
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!