フィルターのクリア

Info

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

How to solve the error "In an assignment A(I) = B, the number of elements in B and I must be the same."

2 ビュー (過去 30 日間)
Sneha P S
Sneha P S 2018 年 3 月 19 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
for i = 1:65535
RR(i+1)=mod((double(R(i))+GG(i)+BB(i)),256);
GG(i+1)=mod((RR(i)+double(G(i))+BB(i)),256);
BB(i+1)=mod((RR(i)+GG(i)+double(B(i))),256);
end
for i = 1:65536
RRbin(i) = [ fix(rem(fix(RR(i))*pow2(-(16-1):0),2)), fix(rem( rem((RR(i)),1)*pow2(1:20),2))];
end
This is the code which i used to convert the decimal values in RR to binary. But the error message is as In an assignment A(I) = B, the number of elements in B and I must be the same. There are 65536 values in RR. How could i solve this ?
  2 件のコメント
Birdman
Birdman 2018 年 3 月 19 日
What about variables other than RR? What are their sizes? At which line the error comes up?
Sneha P S
Sneha P S 2018 年 3 月 19 日
RR, GG, BB are all of size 1x65536 double. I need to convert all these to binary. When i tried the given code in RR the error comes at that line RRbin(i)

回答 (0 件)

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by