Perform the following tasks (label cells as task numbers). Note the first cell (unnumbered) should start with the identification “LAB 1” followed by yourFull Name and section number. Example:
%% Lab 1 by Your_Name_Here Section 61 or 62
In this first lab, you will create some fun-looking Lissajous figures. This will give you an opportunity to learn some basic MATLAB skills and commands.
You can create a vector of time values using the notation:
>> t = start : step : stop
Example:
>> t = 0 : 2 : 10
t =
0 2 4 6 8 10
Notice the values are printed to the screen. This can be a problem if you are plotting points and hundreds of numbers clutter your screen. To suppress such unwanted output, terminate the line with a semi-colon.
>> t = 0 : 2 : 10;
Question 1: Create a new section using %%, and generate a vector t of numbers from 0 to 2π using a step-size of 0.01 You can find π by typing pi
Use the size command to find the exact number of points in your time vector t.
You can learn more about this command by typing:
|
>> help size
Questions2-5:(4 points)
Create the following outputs using proper Matlab syntax. This assumes the vector t has already been defined.
Using subplot, plot: y1(t) vs t, y2(t) vs t and y2(t) vs y1(t). You should be able to get a tiled plot similar to that shown below, but which uses different constants. Your graphs will be slightly different!Here is some code to get you started with the first tile. (Assumes the time vector has already been entered.)
figure
y1 = sin(5*t);
subplot(2,2,1)
plot(t, y1, ‘r’, ‘LineWidth’, 2)
set(gca,’fontsize’, 18);
grid on
title(‘y1(t)’)
axis([0 2*pi -1 1])
xlabel(‘t’)
Replace the tiled plot below with your final plot for four points.
The graph below is for and instead.
Question 6:What happens to the Lissajous curve if both of the arguments to the sine and cosine waves double?
|
Question7: What shape is the Lissajous curve if instead: and ?
Notice, the constants are the same.
|
Question8: What shape is the Lissajous curve if instead: and ?
|
Questions 9 and 10:Just for fun, run the code in the file Lissajous_fun.m that is based on code written by Nick Trefethen. It uses some advanced notions that you need not master at this stage. Run the file a few times, trying different parameter values in the last section with the 3D cube. Then paste in your favorite “Cube with Lissajous Faces” image.
Paste 3D cube here.
Recuerda que este tipo de ofertas suelen tener restricciones temporales, por lo que vale la…
Systems of governance and authority Systems of governance and authority can have a profound influence…
compare and contrast The essay should be compare and contrast essay and talk about 3…
The Demise of Guys http://www.ted.com/talks/lang/en/zimchallenge.html After watching the video, Philip Zimbardo: The Demise of Guys?,…
what effect does being married for more than one year have on couples gaining weight…
California Disaster Prepardness For this Assignment, you are the EOC Director in your own community.…