Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 781849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:17:43+00:00 2026-05-14T20:17:43+00:00

I would like to create an animation to demonstrate LDPC coding which is based

  • 0

I would like to create an animation to demonstrate LDPC coding which is based on Sum-Product Algorithm

So far I have created a graph which shows the connections between symbol nodes (left) and parity nodes (right)alt text http://img29.imageshack.us/img29/9780/ldpc.jpg and would like to animate points travelling from symbol to parity nodes and back.

The figure is drawn by executing the following method:

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;

So what I would like to do here is to add another method which takes start point (x and y) and end point as arguments and animates a travelling circle (dot) from start to end and back along the displayed lines.

I would appreciate if anyone of you could show the solution or suggest any useful tutorial about matlab simulations.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:17:43+00:00Added an answer on May 14, 2026 at 8:17 pm

    I believe the best way to learn is by example. So I suggest you look at the demo lorenz which comes with MATLAB:

    edit lorenz
    

    For other cool animations, look for orbits.m and swinger.m demos part of Cleve Moler’s book: Experiments with MATLAB


    I show here a simple animation of a point moving along a circular path. The hold idea boils down to using EraseMode set to xor, and updating XData and YData of the point for each iteration:

    %# coordinates
    t = (0:.01:2*pi)';         %# 'fix SO syntax highlight
    D = [cos(t) -sin(t)];
    
    %# setup a figure and axis
    hFig = figure('Backingstore','off', 'DoubleBuffer','on');
    hAx = axes('Parent',hFig, 'XLim',[-1 1], 'YLim',[-1 1], ...
              'Drawmode','fast', 'NextPlot','add');
    axis(hAx, 'off','square')
    
    %# draw circular path
    line(D(:,1), D(:,2), 'Color',[.3 .3 .3], 'LineWidth',1);
    
    %# initialize point
    h = line('XData',D(1,1), 'YData',D(1,2), 'EraseMode','xor',  ...
            'Color','r', 'marker','.', 'MarkerSize',50);
    %# init text
    hTxt = text(0, 0, num2str(t(1)), 'FontSize',12, 'EraseMode','xor');
    
    i=0;
    while true
        i = rem(i+1,numel(t)) + 1;               %# circular increment
        set(h,'XData',D(i,1), 'YData',D(i,2))    %# update X/Y data
        set(hTxt,'String',num2str(t(i)))         %# update angle text
        drawnow                                  %# force refresh
        if ~ishandle(h), return; end             %# in case you close the figure
    end
    

    For a detailed explanation of the parameters used (EraseMode, Backingstore, DoubleBuffer, ..), refer to this animation guide

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 443k
  • Answers 443k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer > is the child combinator, sometimes mistakenly called the direct… May 15, 2026 at 6:10 pm
  • Editorial Team
    Editorial Team added an answer Yes, you can used the closed-form expression: where You can… May 15, 2026 at 6:10 pm
  • Editorial Team
    Editorial Team added an answer You'll have to load the results of your query into… May 15, 2026 at 6:10 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.