フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

"Assignment has more non-singleton rhs dimensions than non-singleton subscripts" how to solve this error?

1 回表示 (過去 30 日間)
z m
z m 2017 年 12 月 7 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello,
I got the error "Assignment has more non-singleton rhs dimensions than non-singleton subscripts" in a line of code
ber(k,iter)=sum(abs((decoded_bits - X)));
the codes is:
N=64;
X=randi( [0 1],N, 1);
...
for k=1:length(SNR)
...
for iter=1:Iteration
...
decoded_bits=zeros(1,N);
decoded_bits(LAPPR_mod>0)=1;
if BCJR==0
ber(k,iter)=sum(abs((decoded_bits - X)));
...
How to solve this error?

回答 (1 件)

KL
KL 2017 年 12 月 7 日
What exactly are you trying to do?
X has 64 rows and 1 column
decoded_bits has 1 row and 64 column
and when you say,
decoded_bits - X
you get 64 rows and 64 columns (implicit expansion).
when you make sum out of it, you still get 1 row and 64 columns and you're trying to assign it to one element of ber.

この質問は閉じられています。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by