Define the following equation as an anonymous function in MA

Define the following equation as an anonymous function in MATLAB. a = (cosine(x))^5/2 * (x - 4)^2 - x^1/3 Plot over the range from 0 to pi/2. Create a vector from 0 to pi/2 with an increment of pi/8 and evaluate the above function over this range. Plot the data. Also, Define the following as an anonymous function and create the vector of values listed. g = sin^2(x) + (cos(x))^2/sin(x)-cos(x) x = [0 pi/8 pi/6 pi/4 pi/2] Create a function file for which both the anonymous function and the vector are input

Solution

program

clc
clear;
x=0:0.01:pi/2;
a=(cos(x)).^(5/2).*(x-4).^2-x.^(1/3);
figure
plot(a)
x=[0 (pi/8) pi/4 3*pi/8 pi/2];
for i=1:5,
    a(i)=(cos(x(i))).^(5/2).*(x(i)-4).^2-x(i).^(1/3);
end
disp(\'a\');
disp(a);
figure
plot(a)
x=[0 (pi/8) pi/4 pi/2];
for i=1:4,
    g(i)=sin(x(i))+(cos(x(i)))^(2)/(sin(x(i))-cos(x(i)));
end
figure
plot(g)

 Define the following equation as an anonymous function in MATLAB. a = (cosine(x))^5/2 * (x - 4)^2 - x^1/3 Plot over the range from 0 to pi/2. Create a vector f

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site