Understanding basics of struct?
Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!!Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!! Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?
Big Thanks!!! struct, filepath, struct2cell, struct length, struct sort, basics MATLAB Answers — New Questions