Hello,
I have a code which I am trying to get running faster, it has 3 fitcsvm function. To do so (I cannot use the GPU) I decided to perform a parfor loop.
However, I cannot use the save function and if the save is outside the loop a 'variable not found' error occurs
parfor i = 1:3 if i == 1 SVM_tt = fitcsvm(features_dt(:,1:10),features_dt(:,11),... 'Standardize',true,'KernelFunction','RBF','BoxConstraint', tt_C, 'KernelScale',tt_sigma); end if i == 2 SVM_bb = fitcsvm(features_bp(:,1:10),features_bp(:,11),... 'Standardize',true,'KernelFunction','RBF','BoxConstraint', bb_C, 'KernelScale',bb_sigma); end if i == 3 SVM_ss = fitcsvm(features_swa(:,1:10),features_swa(:,11),... 'Standardize',true,'KernelFunction','RBF','BoxConstraint', ss_C, 'KernelScale',ss_sigma); endendsave('SVM_dt.mat','SVM_tt');save('SVM_bp.mat','SVM_bb');save('SVM_swa.mat','SVM_ss');
Without the parfor loop the code wors perfectly fine.
Thank you,
Best Answer