generating a usable Matlab variable from csv file

조회 수: 1 (최근 30일)
Daniel
Daniel 2014년 8월 28일
댓글: Daniel 2014년 8월 28일
Is there anything along the lines of import wizard that can generate a variable, which you can then place in a matlab script? For example if you had a column in your csv file called "test" with row values of 1, 2, 3, matlab would create the following
test = [1 2 3];
which you could then obvioulsy use in your matlab code.
Or is something I would probably have to write a script myself to achieve?
  댓글 수: 2
José-Luis
José-Luis 2014년 8월 28일
Depends on how the csv file looks like
Daniel
Daniel 2014년 8월 28일
Right...I guess I was hoping you could use either cell arrays or just straight vectors depending on the data type it encounters

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

채택된 답변

Sean de Wolski
Sean de Wolski 2014년 8월 28일
In R2014a, we introduced matlab.io.saveVariablesToScript which does this.
  댓글 수: 1
Daniel
Daniel 2014년 8월 28일
looks like I'll have to upgrade. Thank you.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by