load txt as structure

조회 수: 2 (최근 30일)
Fabrizio Marangio
Fabrizio Marangio 2016년 6월 10일
답변: TastyPastry 2016년 6월 10일
If i have a .txt file of this type:
Name Jack Surname Black Date 10/06/2016
is there a way to load it in matlab as a structure with name, surname and date as fields and jack, black and 10/06/2016 as values? Thanks

답변 (1개)

TastyPastry
TastyPastry 2016년 6월 10일
Let's say your input line is stored in data:
in = strsplit(data);
st=struct(in{1},in{2},in{3},in{4},in{5},in{6});

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by