【发布时间】:2015-10-09 16:28:34
【问题描述】:
我有以下 matlab 代码,我想在没有 for 循环的情况下编写: 该代码将满足特定条件的值分配给稀疏矩阵。 II、JJ为稀疏矩阵索引。
all_tanh_bits = ones(1, NUMBER_OF_EQ);
%Calculating each equation multipicative factor.
for index = 1 : length(II)
all_tanh_bits(II(index)) = (all_tanh_bits(II(index)) * ...
tanh(messages_matrix(II(index), JJ(index))/2));
end
for index = 1 : length(II)
%not_relevant_mul is the elemnt to divide - so the
%current node only uses other message nodes for
%calculating the llr.
not_relevant_mul = tanh(messages_matrix(II(index), ...
JJ(index)) / 2);
check_matrix_mul = all_tanh_bits(II(index)) / not_relevant_mul;
check_matrix(II(index), JJ(index)) = ...
log((1 + check_matrix_mul) / (1 - check_matrix_mul));
end
【问题讨论】:
标签: matlab