Effacer les filtres
Effacer les filtres

load txt as structure

1 vue (au cours des 30 derniers jours)
Fabrizio Marangio
Fabrizio Marangio le 10 Juin 2016
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

Réponses (1)

TastyPastry
TastyPastry le 10 Juin 2016
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});

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by