How to make variable names the same as the column headers when importing?
조회 수: 2 (최근 30일)
이전 댓글 표시
Notes:
My column headings are V(001), I(B54)... There are thousands of them.
Currently if I use the import wizard, the column headers do not get used for the variable names. Matlab assigns VarName1, VarName2,...
I am importing a text file.
댓글 수: 4
per isakson
2015년 4월 15일
"Is there a way to have Matlab remove the parenthesis?"
- With importdata   AFAIK: No!
- With textscan   Yes, but it takes a some lines of code.
Questions
- Do you really want 3400 separate variables?
- Do you know the types of the data in each column - string or numerical?
답변 (1개)
Image Analyst
2015년 4월 16일
I think the best approach is to use readtable() so that your fields have the names of your column headers. I think it will throw out the parentheses though.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!