Animation, MATLAB in Mathematics

Animation:

In this part we will observe a couple of ways to animate a plot. These are visuals, therefore the outcomes can't really be shown here; it is essential to type these into a MATLAB to view the results.

We begin by animating a plot of sin(x) with the vectors:

>> x = -2*pi : 1/100 : 2*pi;

>> y = sin(x);

This results in sufficient points that we will be able to view the result by using the built-in comet function, that shows the plot by first displaying the point (x(1),y(1)), and then moving on to the point (x(2),y(2)), and so forth, leaving a trail of all the earlier points.

   >> comet(x,y)

The final result looks similar as plot(x,y).

The other way of animating is to use the built-in function movie that shows recorded movie frames. The frames are captured in a loop by using the built-in function getframe, and are stored in the matrix. For illustration, the script below again animates the sin function. The axis function is used so that the MATLAB will use similar set of axes for all frames, and by using the min and max functions on the data vectors x & y will permit us to see all points.

It shows movie once in the for loop, and then again whenever the movie function is called.

2091_Animation.png

Posted Date: 10/22/2012 1:51:45 AM | Location : United States







Related Discussions:- Animation, Assignment Help, Ask Question on Animation, Get Answer, Expert's Help, Animation Discussions

Write discussion on Animation
Your posts are moderated
Related Questions
Empty Vectors: An empty vector or in another words, a vector which stores no values, can be generated using the empty square brackets: >> evec = [] evec = [] >> lengt

Use of string variables: The Characters involve letters of the alphabet, punctuation marks, digits, white space, and control characters. The Control characters are characters

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Illustration of Standard Deviation The less spread out the numbers are, therefore smaller the standard deviation will be, as it is a way of determining the spread of the data.

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

Write a MATLAB function [d1, u1, l1, c1, r1] = NaiveGaussArrow(d, u, l, c, r) that takes as input the 5 vectors de ned above representing A. This function performs Naive Gauss redu

Built-in function for Differentiation: The MATLAB has a built-in function, diff that returns the differences between consecutive elements in a vector. For illustration, >>

Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

Recursive Functions: The Recursion occurs whenever something is defined in terms of itself. In the programming, a recursive function is a function which calls itself. The Recu

sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp