필터 지우기
필터 지우기

How to give name to cell in variables column?

조회 수: 25 (최근 30일)
PriTi
PriTi 2016년 8월 1일
댓글: Guillaume 2016년 8월 1일
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
John D'Errico
John D'Errico 2016년 8월 1일
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
Guillaume 2016년 8월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 1일
편집: Azzi Abdelmalek 2016년 8월 1일
columnname=genvarname(repmat({'col'},1,12),'col')
%or
columnname={'a','b','c','d'}

Star Strider
Star Strider 2016년 8월 1일
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.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by