Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Problem 2.10 The following equation can be used to compute values of y as a function of
Description: The following equation can be used to compute values of y as a function of x: y = be−ax sin(bx) (0.012x4 − 0.15x3 + 0.075x2 + 2.5x) where a and b are parameters. Write the equation for implementation with MATLAB, where a = 2, b = 5, and x is a vector holding values from 0 to π∕2 in increments of Δx = π∕40. Employ the minimum number of periods (i.e., dot notation) so that your formulation yields a vector for y. In addition, compute the vector z = y2 where each element holds the square of each element of y. Combine x, y, and z into a matrix w, where each column holds one of the variables, and display w using the short g format. In addition, generate a labeled plot of y and z versus x. Include a legend on the plot (use help to understand how to do this). For y, use a 1.5-point, dashdotted red line with 14-point, rededged, white-faced pentagram-shaped markers. For z, use a standard-sized (i.e., default) solid blue line with standard-sized, blue-edged, green-faced square markers.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Prob02010
MATLAB Code:
%clear all variables from workspace
clear all
% define a vector x from 0 to pi/2 with interval of pi/4
x=0:pi/40:pi/2
% define parameters a and b
a=2;
b=5;
%write down the expression for y in form of parametes a,b and variable x
y=b*exp(-a
...
*sin(b
...
012*(x
...
15*(x
...
075*(x
...
5*x)
z=y
...
5 with 14 size red edged
and white faced pentagram markers
plot(x,y,'-rp','LineWidth',1
...
Then I defined the expression for
dependent variables y and z using dot notation so that it computes everything element wise
...
And final I plotted x versus y and x versus z graphs
using given specification
...
And values of w in matrix form where column
represents x, y and z respectively and got a plot of x-y and x-z with legends
...
I also learned plots and how to set their properties and mark legends
Title: Problem 2.10 The following equation can be used to compute values of y as a function of
Description: The following equation can be used to compute values of y as a function of x: y = be−ax sin(bx) (0.012x4 − 0.15x3 + 0.075x2 + 2.5x) where a and b are parameters. Write the equation for implementation with MATLAB, where a = 2, b = 5, and x is a vector holding values from 0 to π∕2 in increments of Δx = π∕40. Employ the minimum number of periods (i.e., dot notation) so that your formulation yields a vector for y. In addition, compute the vector z = y2 where each element holds the square of each element of y. Combine x, y, and z into a matrix w, where each column holds one of the variables, and display w using the short g format. In addition, generate a labeled plot of y and z versus x. Include a legend on the plot (use help to understand how to do this). For y, use a 1.5-point, dashdotted red line with 14-point, rededged, white-faced pentagram-shaped markers. For z, use a standard-sized (i.e., default) solid blue line with standard-sized, blue-edged, green-faced square markers.