the variable can't be classified with parfor

I have large code and need fix the error of variable(perror) as can't be classified and I can summarized my code.
ind=1; indx =1; limit=4; % Opening the output file
fid=fopen('Parallel_k_n_L_test_16_6_2014.txt','wt');
parfor SNR=0:5
undetected_errors = 0;
SNR
frmerror=0;
bitnerr=0;
frames=0;
.
.
.
.
% Decoder ---------------
[success,kr,dd0,x_hat1]=turbo_decoder_infectious_no_int_z_9_6_2010(rcv,si,H1,co,fid,frames);
% ---------------------------------------------
dseq1=dd0;
% B E R ------------------
error=sum(abs(dseq1-b));
perror1=error/size(b,2);
perror(frames)=perror1; %(the problem here)
if error~=0
frmerror=frmerror+1
bitnerr=bitnerr+error;
if success == 1
undetected_errors = undetected_errors +1;
c_w(indx,:) = co;
noise_w(indx,:) = noise;
b_w(indx,:) = b;
kr_w(indx,:) = kr;
x_hat1_w(indx,:) = x_hat1;
indx = indx +1;
end
end
merror=mean(perror);
ferror(ind)=merror;
frmerr(ind)=frmerror;
ind=ind+1;
bits=frames*size(G1,1);
BER=bitnerr/bits
FER=frmerror/frames
end
fclose('all');
semilogy(SNR,BER);
the result un error as the variable perror can't be classified
so plz can anyone help me fix the problem me make other other variables and shall need matlabpool for high speed? also my program working well for.

Answers (0)

This question is closed.

Tags

Asked:

on 7 Sep 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!