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
2021-6-17
No in the case, your approach is better. It works even with me without issues.
采纳的回答
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 Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!