MATLAB Answers

invalid concatenation of structure with matrix

2 views (last 30 days)
Here's the full code:
folderTestCur = fullfile(folderTest,setTestCur);
ext = {'*.jpg','*.png','*.bmp'};
filepaths = [];
for i = 1 : length(ext):
filepaths = cat(1,filepaths,dir(fullfile(folderTestCur, ext{i})));
end
  6 Comments

Sign in to comment.

Accepted Answer

Stephen Cobeldick
Stephen Cobeldick on 18 Jun 2021
P = fullfile(folderTest,setTestCur);
X = {'*.jpg','*.png','*.bmp'};
N = numel(X);
C = cell(1,N);
for k = 1:N
C{k} = dir(fullfile(P,X{k}));
end
F = vertcat(C{:})

More Answers (0)

Community Treasure Hunt

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

Start Hunting!