Animation, MATLAB in Mathematics

Assignment Help:

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


Related Discussions:- Animation

Script a MATLAB program, Script a MATLAB program which meets the following ...

Script a MATLAB program which meets the following speci cations: The program expects an input of a two-variable real-valued continuous function f : R^2--> R The program is to cal

Plot functions, Plot Functions: Faraway, we have plotted to generate t...

Plot Functions: Faraway, we have plotted to generate two-dimensional plots and bar to generate bar charts. We have seen how to clear the Figure Window by using clf, and how to

Referring to and modifying the matrix elements, Referring to and Modifying ...

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

Three-dimensional plots, Three-Dimensional Plots: The MATLAB has many ...

Three-Dimensional Plots: The MATLAB has many functions which will display three-dimensional plots. Most of these functions have similar name as corresponding two-dimensional p

Illustrations of variable number of output arguments, Illustrations of Vari...

Illustrations of Variable number of output arguments: In the illustrations shown here, the user should actually know the type of the argument in order to establish how many va

Naive Gauss Reduction, Write a MATLAB function [d1, u1, l1, c1, r1] = Naive...

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

Recursive functions, Recursive Functions: The Recursion occurs wheneve...

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

Writing and reading spreadsheet files, Writing and Reading Spreadsheet File...

Writing and Reading Spreadsheet Files: The MATLAB functions xlswrite & xlsread will write to and read from the spreadsheet files which have the extension .xls. For illustratio

Concatenation, Concatenation: The String concatenation means to join t...

Concatenation: The String concatenation means to join the strings altogether. Of course, as strings are merely vectors of the characters, the technique of concatenating vector

Creating string variables, Creating string Variables: The string consi...

Creating string Variables: The string consists of a few numbers of characters (including, possibly, none). These are the illustrations of the strings: '' 'x' 'ca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd