the error " Assignment has more non-singleton rhs dimensions than non-singleton subscripts" when happen?
이전 댓글 표시
K=128;
N=4;
QPSk_Set=[1 -1 1j -1j];
Phase_Set=[1 -1];
MAX_SYMBOLS=1e5;
PAPR_Orignal=zeros(1,MAX_SYMBOLS);
PAPR_SLM=zeros(1,MAX_SYMBOLS);
X=zeros(N,K);
Index=zeros(N,K);
for nSymbol=1:MAXSYMBOLS
Index(1,:)=randi(1,K,length(QPSK_Set))=1;
Index(2:N,:)=randi(N-1,K,length(Phase_Set))+1;
end
the error ' Index(1,:)=randi(1,length(QPSk_Set))+1 '
I need help ! How do i solve it??
채택된 답변
추가 답변 (1개)
Index(1,:)=randi(1,K,length(QPSK_Set))=1;
appears a typo; above wouldn't run. But, the error as given is because the size of subscripting expression (1,:) is a column vector of K elements but you generated a Kx4 array from |randi(1,K,length(QPSK_Set))|. You can't put a 128x4 array into one column; the error is telling you that.
댓글 수: 2
long zhang
2018년 11월 21일
Nur Qamarina
2020년 4월 17일
hye can i know how you solve the array problem?
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!