What does this for-loop do?

1 view (last 30 days)
Golnar
Golnar on 13 Jul 2018
Commented: Golnar on 13 Jul 2018
for i=1:numSubj(group)
subj=cell2mat(subjIDs{group}{1}(i, :))
subjDir=[/somewhere/somewhere];
v=dlmread(subjDir);
FCall=(i, :, :)=v;
end
  8 Comments
Adam Danz
Adam Danz on 13 Jul 2018
Here's a brief look at what's going on and it's very vague because the code is vague.
for i=1:numSubj(group) %Loop through 1 to some other number defined by numSubj(group)
subj=cell2mat(subjIDs{group}{1}(i, :)) %subj should be a matrix if the code works. subjIDs is a cell array of cell arrays.
subjDir=[/somewhere/somewhere]; % ??? (will break)
v=dlmread(subjDir); % see 'help dlmread'
FCall=(i, :, :)=v; % ?? This will break
end
Golnar
Golnar on 13 Jul 2018
Thank you. I'm a Research Assistant adapting a script to fit our current set up.

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!