Skipping steps while loading data? Debugging tool used
조회 수: 1 (최근 30일)
이전 댓글 표시
Script does not execute the steps after for i loop? What could be the fault? Thanks!
startpath ='E:\MATLAB\1EXAMENOPDRACHT';
addpath([startpath,'\Assignment_V2']);
Datapath = [startpath '/Data'];
for i = [3 5 7 9 11 13 14 15 16 17]
dataFolder = [Datapath '/TD' num2str(i)];
filePattern = fullfile(dataFolder, '**/EMG/HR*.mot'); %naam van de map een bestandsnaam geven
pathwayEMG_HR = dir(filePattern);
for k = 1:length(pathwayEMG_HR)
EMGHRmaartendata = importdata([dataFolder '/EMG/HR_' num2str(k) '_emg.mot']); % om matlab file van subject te loaden
end
end
댓글 수: 0
답변 (2개)
Cris LaPierre
2020년 12월 15일
Is it skipping it or just not giving you the expected result? Have you checked that the path and file name for your importdata code is correct?
Are there any error messages? If so, please share the entire error message (all the red text).
If you go through the trouble of creating pathwayEMG_HR, why not use it to import your data?
EMGHRmaartendata = importdata(fullfile(pathwayEMG_HR(k).folder,pathwayEMG_HR(k).name));
Note that you are overwriting EMGHRmaartendata every time. You probably want to come up with some strategy to keep all of it. For an example, see this video.
댓글 수: 9
Cris LaPierre
2020년 12월 16일
The issue is with the "data.data()" part. You are adding an extra field name that doesn't exist.
EventMRdata = rand(4,5);
AEMGstructMR(1,4).data = EventMRdata;
AEMGstructMR(1,4).data(:,1)
AEMGstructMR(1,4).data.data(:,1)
Sounds like this is for a class. Do you have an instructor or TA who could look at what you are doing? They'll have the proper context to answer the questions you are asking.
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!