Removing Struct from Cell Array
5 views (last 30 days)
Show older comments
Hello,
I use the following code to load files from the folder
[files,pathToFiles] = uigetfile('*.mat',...
'Select One or More Files', ...
'MultiSelect', 'on');
out = {};
if ~iscell(files)
out{1} = load(fullfile(pathToFiles, files));
else
for k = 1:length(files)
out{k} = load(fullfile(pathToFiles, files{k}));
end
end
I have this one file, It is a struct with three fields stored as a cell array, it looks like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/315822/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/315825/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/315828/image.jpeg)
Is there any way, I can remove the 1x1 struct and make the file directly a cell array, like a 3x1 cell array, remove the struct part.
I have attached the file as well with the question.
Does anybody know how to do it?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Structures in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!