Hi everyone!
I'm using a research app (ScanImage) that creates many struct files with names of the kind A_1, A_2, A_3 … A_n. I want to extract the field 'data' from each one of this struct files and place it in a cell or simply create the matrix A1, A2, A3 with only the data from 'data'.
A1{1,1} = A_1.data; A1{1,2} = A_2.data; etc. This will create the cell array, but I wanna do it will all the files at once!
I've trying to use this loop, but it's not working yet:
fileFolder = fullfile('location of your files in your PC');dirOutput = dir(fullfile(fileFolder,'A_*.mat'));fileNames = {dirOutput.name};numFrames (1) = numel(fileNames);ALLDATA {1,1} = A_1.data;for cidx = 2:numFrames ALLDATA {1,cidx} = fileNames(cidx); end
I end up by having a cell array with the text of the name of each file, but not the real data or even the struct array pasted there in the cell array.
I would pretty much appreciate your help!
Thanks!
Best Answer