Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

1 次查看(过去 30 天)
flag = 1;
n = 1;
while flag == 1
if feof(fid)
flag=-1;
else
tmp = fgets(fid);
while size(tmp,2) < columnwidth;tmp = [tmp,' '];end
subjectID(n,:)=tmp;n=n+1;
end
end
Recieving this error regarding subjectID(n,:)=tmp;n=n+1;
Ran this script/code previously in Matlab2019 so unsure if this might be why this issue is arising now? Any insight would be greatly appreciated!

采纳的回答

VBBV
VBBV 2021-4-7
%if true
subjectID{n,:}=tmp;n=n+1
  1 个评论
Vanessa Lopez
Vanessa Lopez 2021-4-7
Thank you! That worked, however, I am next receiving this error:
Error using cd
Path must be a string scalar or character vector.
In regards to this line of code:
tmp_subjectID = deblank(subjectID(master,:));
currentdir = [subject_folder,'/',tmp_subjectID,'/mri/assembly'];
cd (currentdir);
I'm wondering if it has something to do with the defined tmp_subjectID from the prior error?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by