why do I get the error : Index exceeds matrix dimensions?
Ältere Kommentare anzeigen
hello all! I am trying to do channel estimation using compressive sensing using basis pursuit denoising from spgl in matlab. following is my code segment. but I am constantly getting the error:
Index exceeds matrix dimensions.
Error in partialFourier (line 8)
y = z(idx);
Error in @(x,mode)partialFourier(p,ofdm.N,x,1)
Error in aunt (line 106)
Rb=opA(y(i),1);
I have tried to match the dimensions of both but its not working. can anyone help me please.
%%%%%%%%%%%%%%%%%%code for spg_bpdn%%%%%%%%%%%%%%
ofdm.N=128;
ofdm.PP=13;
ofdm.B=1;
%%Saprse Channel estimation
H_Sparse = zeros(ofdm.N,ofdm.B);
m=50;k=14;
for b = 1 : ofdm.B
p = randperm(ofdm.N); p = p(1:k);
opts = spgSetParms('verbosity',0);
opA= @(x,mode) partialFourier(p,ofdm.N,x,1);
y=zeros(ofdm.N,1);
y(p) = ofdm.N/ofdm.NP *fft(ifft(dataRxFFT(ofdm.PP,1)));
y=y(p);
Rb=opA(y(p),1);
x=spg_bpdn(@(x,mode)opA(x,mode),Rb,0.05,opts);
H_Sparse(:,1)=ofdm.N/ofdm.NP * fft(ifft(vec2mat(x,ofdm.N)));
end
3 Kommentare
dpb
am 27 Aug. 2014
The error was an assignment in the function partialFourier (line 8)
y = z(idx);
but none of the code you posted has anything to do directly with it...
One presumes by the variable name that idx is an index value (or possibly an array from find or the like) and that the returned value is outside the ranges you're expecting...
Image Analyst
am 27 Aug. 2014
fft(ifft(X)) = X, so what's going on there?
Akzeptierte Antwort
Weitere Antworten (1)
bena
am 29 Aug. 2014
Kategorien
Mehr zu Image Transforms finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!