Info

此问题已关闭。 请重新打开它进行编辑或回答。

How to eliminate row by comparing two matrix with different row dimensions

2 次查看(过去 30 天)
scm = randi(0:1,3,16)
scm =
1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0
1 1 1 0 0 0 1 1 1 1 0 0 0 0 1 0
0 0 1 1 1 1 1 1 1 0 0 1 1 0 0 1
scm_replaced(scm_replaced == 0) = -1
scm_replaced =
1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1
1 1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 -1
-1 -1 1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 1
volts0 = scm_replaced(1,:)*(-randn)
volts1 = scm_replaced(2,:)*(-randn)
volts2 = scm_replaced(3,:)*(-randn)
voltsadd = volts0 + volts1 + volts2
signal_passing = voltsadd
Despread_alluser_i1 = xor(signal_passing,scm)
count_row1_for1 = nnz(Despread_alluser_i1(1,:) == 1)
count_row1_for0 = nnz(Despread_alluser_i1(1,:) == 0)
sub_row1_user1 = count_row1_for1 - count_row1_for0
sub_row_user1_abs = abs(sub_row1_user1)
count_row2_for1 = nnz(Despread_alluser_i1(2,:) == 1)
count_row2_for0 = nnz(Despread_alluser_i1(2,:) == 0)
sub_row2_user2 = count_row2_for1 - count_row2_for0
sub_row_user2_abs = abs(sub_row2_user2)
count_row3_for1 = nnz(Despread_alluser_i1(3,:) == 1)
count_row3_for0 = nnz(Despread_alluser_i1(3,:) == 0)
sub_row3_user3 = count_row3_for1 - count_row3_for0
sub_row_user3_abs = abs(sub_row3_user3)
abs_tag0 = sub_row_user1_abs
abs_tag1 = sub_row_user2_abs
abs_tag2 = sub_row_user3_abs
if (abs_tag0>abs_tag1) && (abs_tag0>abs_tag2)
count_new_tag = abs_tag0;
sci_new = scm(1,:)
elseif (abs_tag1>abs_tag0) && (abs_tag1>abs_tag2)
count_new_tag = abs_tag1;
sci_new = scm(2,:)
else
count_new_tag = abs_tag2;
sci_new = scm(3,:)
if (count_new_tag>8)
count_new_tag=1;
end
end
reconstructed_spreaddata_code2_sc1 = xor(count_new_tag,sci_new)
The main idea is to reconstruct a signal by taking the result of the strongest despread (which is multiplication of count_new and sci_new) sci_new plays a important role as its the answer of which row is strongest from the matrix scm. now in this case sci_new is row 3 from scm. I cosider the result in sci_new as the strongest and once it is executed i want to eliminate that row from scm matrix so that I can do the reconstructed_spreaddata for the remaining user.
how do i do it?? i am using scm(sci_new, :) = [] but its showing errors may be it is because scm is 3:16 and sci_new is 1:16
how do i write a code that will eliminate the row present in sci_new as i have to repeat the process from if (abs_tag0>abs_tag1) && (abs_tag0>abs_tag2) till reconstruced_spreaddata
basicially in first iteration its doing despread for all tags (despread = xor(a,b)) it gets counts of 1's and 0's understand one row gives strongest result (i.e it refers scm) the next step is eliminate that row and carry on the process of despread fro remaining
  1 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2018-11-20
Based on question heading, the question seems easy, please concise the question (edit the question), what exactly you are looking for?

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by