Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Error: Assignment has more non-singleton rhs dimensions than non-singleton subscripts
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello Matlab Experts,
I am running into the following error when I run my script: Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in Extract_Beta_Per_Subj_From_116AAL_ROIs_REW22_by_Regressors_text (line 42)
AverageBeta(Subj, betaIndex) = max( mY_data(:,1) );
I searched through matlab and found some helpful advice, but I am still not entirely sure how to fix. Any suggestions would be greatly appreciated!
Below is my entire code:
ROIs_dir = 'X:\TRAUMA\ANALYSES\MID_Roee\AAL_116_ROIs';
SubjDir = 'X:\TRAUMA\ANALYSES\MID_Roee';
Subjs = {'ELS_001' 'ELS_002' 'ELS_003' 'ELS_004' 'ELS_006' 'ELS_007' 'ELS_009' 'ELS_010' 'ELS_011' 'ELS_012' 'ELS_013' 'ELS_014' 'ELS_017' 'ELS_020' 'ELS_021' 'ELS_022' 'ELS_026' 'ELS_027' 'ELS_028' 'ELS_030' 'ELS_036' 'ELS_039' 'ELS_041' 'ELS_043' 'ELS_044' 'ELS_045' 'ELS_047' 'ELS_048' 'ELS_051' 'ELS_052' 'ELS_053' 'ELS_055' 'ELS_057' 'ELS_058' 'ELS_059' 'ELS_060' 'ELS_069' 'ELS_071' 'ELS_072' 'ELS_077' 'ELS_080' 'ELS_082' 'ELS_084' 'ELS_086' 'ELS_089' 'ELS_091' 'ELS_093' 'ELS_096' 'ELS_097' 'ELS_101' 'ELS_103' 'ELS_106' 'ELS_108' 'ELS_111' 'ELS_114' 'ELS_115' 'ELS_119' 'ELS_122' 'ELS_127' 'ELS_130' 'ELS_133' 'ELS_134' 'ELS_136' 'ELS_140' 'ELS_141' 'ELS_143' 'ELS_145' 'ELS_147' 'ELS_150' 'ELS_151'};
Results = [ROIs_dir '/BetaValues_116AAL_ROIs_Max_Beta_One_Sheet_Per_Regressor'];
BetaNames = {'Cue_Rew' 'Cue_Pen' 'Cue_Neu' 'FB_Rew' 'FB_Rew_No_Change' 'FB_Pen' 'FB_Pen_No_Change' 'FB_Neu' 'Target' 'Wrong_Move'};
tempDir = dir( fullfile( ROIs_dir, '*roi.mat' ) );
ROIname = { tempDir.name };
%% Loop for all ROIs
for ROInumber = 1:length( ROIname ),
%% Loop for all regressors
for betaIndex = 1:length(BetaNames)
%% Loop for all subjects
for Subj = 1:length(Subjs)
SubjName = strcat(Subjs(Subj));
Beta_DIR = strcat(SubjDir,'/',SubjName{1,1},'/1st_Level_New');
tempDir = dir( [ Beta_DIR( 1, : ), '/*beta*.nii' ] );
%%%for betaIndex = 1:length(BetaNames),
subjectsMat = char( strcat( Beta_DIR, [ '/beta_00' num2str( betaIndex, '%0.2d') '.nii' ] ) );
roi_file = fullfile( ROIs_dir, ROIname{ROInumber} );
rois = maroi( 'load_cell', roi_file );
[ mY_data, multv, vXYZ, mat] = getdata( rois{1}, subjectsMat, 'n' );
mY_data = mY_data';
%%cahnged form mean to max
AverageBeta(Subj, betaIndex) = max( mY_data(:,1) );
end
xlswrite(Results, Subjs, BetaNames{betaIndex}, 'B1');
xlswrite (Results, cellstr(ROIname{ROInumber}(1:end-8)), BetaNames{betaIndex}, ['A', num2str(ROInumber + 1)]);
xlswrite (Results, AverageBeta(:, betaIndex)', BetaNames{betaIndex}, ['B', num2str(ROInumber + 1)]);
end
AverageBeta = [];
end
Thanks
Emily
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!