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

Function xlsread - file function, Function xlsread - file function: Th...

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc

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

Illustration of a recursive function, Illustration of a recursive function:...

Illustration of a recursive function: illustration is of a recursive function which does not return anything, but simply prints. The below function prtwords receives a sentenc

Standard deviation, Standard Deviation The standard deviation is the sq...

Standard Deviation The standard deviation is the square root of variance: The built-in function in a MATLAB for the standard deviation is known as std; the standard dev

Illustration of logical vectors, Illustration of Logical vectors: Call...

Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

Illustration of writing variables to a file, Illustration of Writing variab...

Illustration of Writing variables to a file: For illustration, in the below session in the Command Window, 3 variables are generated; these are then exhibited using who. Then,

Function fopen - file function, Function fopen - file function: The pe...

Function fopen - file function: The permission string in the call to the fopen function identifies that the file is opened for writing to it. Just as when reading from a file,

Use of string variables, Use of string variables: The Characters invol...

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

Plot types - plot functions, Plot types: Besides plot and bar, there a...

Plot types: Besides plot and bar, there are another plot types like stem plots, histograms, stem plots, area plots and pie charts, and also other functions which customize the

Pie chart - plot functions, Pie chart - plot functions: The MATLAB als...

Pie chart - plot functions: The MATLAB also has a function pie which will generate a pie chart. Calling the function with the form pie (vec) draws a pie chart, by using the pe

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