Importing variables from an xlsx/txt file

조회 수: 4 (최근 30일)
amberly hadden
amberly hadden 2015년 8월 20일
댓글: amberly hadden 2015년 8월 21일
Hello everybody-
I was wondering if there is a way to import variables from xlsx or txt file in workspace with names ? I know about import wizard > Column vectors and generate script. But I have huge data set in which variables positions are varying so I'm much interested to read a file with its header so that in workspace I get all variables with that command?
Thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 21일
As I suggested in your other posting, use readtable() .
Otherwise you are asking for variables to be "poofed" into existence based upon the column names. Creating variables dynamically is rarely a good idea.
  댓글 수: 1
amberly hadden
amberly hadden 2015년 8월 21일
Thanks Walter I'm already done with that part now I'm working on outputting struct in a txt file
Regards

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by