How to give name to cell in variables column?
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have .mat file having 12 cloumns , i need to give a column name to each of column in matlab how do i do?
4 Kommentare
John D'Errico
am 1 Aug. 2016
People come to MATLAB knowing only how to use Excel. So they try to use MATLAB as if they were still using Excel, and never bother to learn the capabilities of MATLAB.
Guillaume
am 1 Aug. 2016
A mat file contains variables.
Actually, a mat file can also be a text file, in which case it could possibly have 12 columns.
I don't see the point and have never used the '-ascii' format for mat files, but some people on this forum seem to use it.
Antworten (2)
Azzi Abdelmalek
am 1 Aug. 2016
Bearbeitet: Azzi Abdelmalek
am 1 Aug. 2016
columnname=genvarname(repmat({'col'},1,12),'col')
%or
columnname={'a','b','c','d'}
0 Kommentare
Star Strider
am 1 Aug. 2016
I would create a single cell array (vector) with the names. Save it as a separate variable in your .mat file. If you want to display your data with the names (I assume they are the columns in your array), create a table from the numeric array and the cell array when you load them.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!