invalid concatenation of structure with matrix

1 次查看(过去 30 天)
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 个评论
SALAH ALRABEEI
SALAH ALRABEEI 2021-6-17
No in the case, your approach is better. It works even with me without issues.

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2021-6-18
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{:})

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by