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

  • Home
  • SEARCH
  • 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 8943155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:42:16+00:00 2026-06-15T11:42:16+00:00

I have a y matrix that is a 1001×2 and each column represents the

  • 0

I have a y matrix that is a 1001×2 and each column represents the phase angle of an oscillator. I’m trying to make a matlab movie so that I plot both phase angles at time t for times, one at a time. So basically it should look like 2 points moving around in circles. If I hold on the plot then it seems to be right, except at all the points are on the frames. But if I dont hold on, then only the second plot gets shown in each iteration (there is only a red * every frame). Any idea whats going on and how I can make both points get shown on each frame?

fig1=figure(1);
winsize = get(fig1,'Position');
winsize(1:2) = [0 0];
numframes=100;
A=moviein(numframes,fig1,winsize);
set(fig1,'NextPlot','replacechildren')
i=1;

%hold on
for frame=1:numframes
i=frame*10;
plot(cos(mod(y(i),2*pi)),sin(mod(y(i),2*pi)),'bo');
plot(cos(mod(y(i,2),2*pi)) *1.1,sin(mod(y(i,2),2*pi))*1.15,'r*'); %only this one is shown
axis([-1.5 1.5 -1.5 1.5])
A(:,i)=getframe(fig1,winsize);
end 
  • 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-06-15T11:42:17+00:00Added an answer on June 15, 2026 at 11:42 am

    well, you can hold on during the frame drawing and hold off at the end of the frame drawing. like

     for frame=1:numframes
     i=frame*10;
    
     plot(cos(mod(y(i),2*pi)),sin(mod(y(i),2*pi)),'bo');   
     hold on   % // here
     plot(cos(mod(y(i,2),2*pi)) *1.1,sin(mod(y(i,2),2*pi))*1.15,'r*');
     axis([-1.5 1.5 -1.5 1.5])
     A(:,i)=getframe(fig1,winsize);
     hold off  % // and here
     end 
    

    but in this case you can simply do

     ....
     plot(cos(mod(y(i),2*pi)),sin(mod(y(i),2*pi)),'bo', ... 
         cos(mod(y(i,2),2*pi)) *1.1,sin(mod(y(i,2),2*pi))*1.15,'r*');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a (symmetric) matrix M that represents the distance between each pair of
Hi I have a 3 dimensional matrix that I am trying to convert the
I am trying to encode a matrix that i have (after calculating frame differences)
I have a matrix class that takes the row and column reference type that
I have a sparse matrix that represents a 3D rectangular space. Along some of
Basically I have 14800x8 matrix that has been extracted from matlab as CSV file
Hi I need some help with matlab. I have a matrix that's 500 x
Suppose I have a matrix such that each row is a standard basis vector,
I have a huge matrix that I divided it into some sub matrices and
I have a 2D matrix that I need to add into a 3D matrix,

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.