error 'index exceeds matrix dimensions' MATLAB

k=128;
V=4;
QPSK_Set=[1 -1 1j -1j];
Phase_Set=[1 -1];
Choose=[1 1 1 1; 1 1 1 2; 1 1 2 1; 1 1 2 2; 1 2 1 1; 1 2 1 2; 1 2 2 1; 1 2 2 2; 2 1 1 1; 2 1 1 2; 2 1 2 1; 2 1 2 2; 2 2 1 1; 2 2 1 2; 2 2 2 1; 2 2 2 2];
Choose_Len=16;
Max_SYMBOLS=1e5;
PAPR_Orignal=zeros(1,MAX_SYMBOLS);
for nSymbol=1:MAX_SYMBOLS
Index=randi(1,K,length(QPSK_Set))+1;
X=QPSK_Set(Index(1,:));
x=ifft(X,[],2);%frequency domain signal
%time domain signal
Signal_Power0=abs(x.^2);
Peak_Power0=max(Signal_Power0,[],2);
Mean_Power0=mean(Signal_Power0,2);
PAPR_Orignal(nSymbol)=10*log10(Peak_Power0./Mean_Power0):%Calculate PAPR
end
PAPR_PTS6=zeros(1,MAX_SYMBOLS);
for nSymbol=1:MAX_SYMBOLS
Index6=randi(1,K,length(QPSK_Set))+1;
X6=QPSK_Set(Index6(1,:));
x6=ifft(X6,[],2);
I6=length(X6);
A6=zeros(V,K);
for v=1:V
A6(v,v:V:K)=X6(v:V:K);%Interweave
end
a6=ifft(A6,[],2);
min_value6=10;
end
The error"A6(v,v:V:K)=X6(v:V:K)%Interweave"
I need help, Pease!

回答 (1 件)

madhan ravi
madhan ravi 2018 年 11 月 24 日
編集済み: madhan ravi 2018 年 11 月 24 日

0 投票

sizez of A6(v,v:V:K) and X6(v:V:K) should be the same to perform this operation -> A6(v,v:V:K)=X6(v:V:K)
suspect it should be:
A6(v:V:K)=X6(v:V:K);

6 件のコメント

long zhang
long zhang 2018 年 11 月 24 日
Run,it's wrong! the error"index exceeds matrix dimensions "
madhan ravi
madhan ravi 2018 年 11 月 24 日
So upload all your datas to run your code!
long zhang
long zhang 2018 年 11 月 24 日
OMG,it's so long!
madhan ravi
madhan ravi 2018 年 11 月 24 日
ok what does size(A6) and size(X6) show?
long zhang
long zhang 2018 年 11 月 24 日
The following code has no effect on the prerious one!
madhan ravi
madhan ravi 2018 年 11 月 24 日
The sizes don't even match and your trying to equate them!

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

タグ

質問済み:

2018 年 11 月 24 日

コメント済み:

2018 年 11 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by