i am trying to import data(images) from folder using the below code.

조회 수: 1 (최근 30일)
mayank agrawal
mayank agrawal 2015년 10월 18일
댓글: mayank agrawal 2015년 10월 19일
srcFiles = dir('C:\Users\mynk\Desktop\DIP project\SmartphoneCapturedExposures\Trimmed Dataset\2015-10-14T02-59-27Z\*'); % the folder in which ur images exists
T = struct2table(srcFiles)
for i=3:length(srcFiles)
nameOfFile= T.name{i};
splitString=strsplit(nameOfFile,'_');
mode(i)=splitString{1}; %%error here splitString{1} is an element and mode(i) is also an element so why error
ISO(i)=splitString{2};
EV(i)=splitString{3};
srNo(i)=splitString{4};
end
Error:Subscripted assignment dimension
mismatch.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 10월 19일
splitString{1} is not an element: it is a string, which is a row vector of characters. You are trying to store that row vector into a single position mode(i). You should use
mode{i} = splitString{1};
ISO{i} = splitString{2};
EV{i} = splitString{3};
srNo{i} = splitString{4};

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by