我想創建一個動畫來演示其基於Sum-Product AlgorithmMatlab仿真:點(符號)從開始點移動到終點和背部
到目前爲止,我已經創建了一個圖表LDPC編碼,顯示連接在符號節點(左側)和奇偶校驗節點(右側)之間alt text http://img29.imageshack.us/img29/9780/ldpc.jpg,並且想要動畫從符號到奇偶校驗節點並返回的點。
function drawVertices(H)
hold on;
nodesCount = size(H);
parityNodesCount = nodesCount(1);
symbolNodesCount = nodesCount(2);
symbolPoints = zeros(symbolNodesCount, 2);
symbolPoints(:, 1) = 0;
for i = 0 : symbolNodesCount - 1
ji = symbolNodesCount - i;
scatter(0, ji)
symbolPoints(i + 1, 2) = ji;
end;
parityPoints = zeros(parityNodesCount, 2);
parityPoints(:, 1) = 10;
for i = 0 : parityNodesCount - 1
ji = parityNodesCount - i;
y0 = symbolNodesCount/2 - parityNodesCount/2;
scatter(10, y0 + ji)
parityPoints(i + 1, 2) = y0 + ji;
end;
axis([-1 11 -1 symbolNodesCount + 2]);
axis off
%connect vertices
d = size(H);
for i = 1 : d(1)
for j = 1 : d(2)
if(H(i, j) == 1)
plot([parityPoints(i, 1) symbolPoints(j, 1)], [parityPoints(i, 2) symbolPoints(j, 2)]);
end;
end;
end;
所以我想在這裏做什麼是添加另一這需要啓動點(x和y)和終點作爲參數,並激活方法:
下圖是通過執行以下方法繪製沿着顯示的行從開始到結束並返回到行進的圓圈(點)。
我將不勝感激,如果你們中的任何人都可以展示解決方案或建議任何有關matlab仿真的有用教程。
謝謝!