Iterating through struct fieldnames in MATLAB
You have to use curly braces ({}) to access fields, since the fieldnames function returns a cell array of strings: for i = 1:numel(fields) teststruct.(fields{i}) end Using parentheses to access data in your cell array will just return another cell array, which is displayed differently from a character array: >> fields(1) % Get the first … Read more