MATLAB code to find the integration of three functions:
clc
clear all
syms x a b c
fprintf('Integrate \n')
f1=(sin(3*x))/(cos(x))^5;
pretty(f1)
fprintf('Result1 = \n')
Result1=int(f1);
pretty(Result1)
fprintf('Result1 after simlification using simplify() command
\n')
pretty(simplify(Result1));
fprintf('Integrate \n')
f2=x/((a+c*x^2)^(5/2));
pretty(f2)
fprintf('Result2 = \n')
Result2=int(f2);
pretty(Result2)
fprintf('Result2 after simlification using simplify() command
\n')
pretty(simplify(Result2))
fprintf('Integrate \n')
f3=sin(x)/(a*cos(x)+b*sin(x))^2;
pretty(f3)
fprintf('Result3 = \n')
Result3=int(f2);
pretty(Result3)
fprintf('Result3 after simlification using simplify() command
\n')
pretty(simplify(Result3))
MATLAB OUTPUT:
Integrate
sin(3 x)
--------
5
cos(x)
Result1 =
2
8 cos(x) - 1
-------------
4
4 cos(x)
Result1 after simlification using simplify() command
2
8 cos(x) - 1
-------------
4
4 cos(x)
Integrate
x
-------------
2 5/2
(c x + a)
Result2 =
1
- -----------------
2 3/2
3 c (c x + a)
Result2 after simlification using simplify() command
1
- -----------------
2 3/2
3 c (c x + a)
Integrate
sin(x)
----------------------
2
(a cos(x) + b sin(x))
Result3 =
1
- -----------------
2 3/2
3 c (c x + a)
Result3 after simlification using simplify() command
1
- -----------------
2 3/2
3 c (c x + a)
None of results simplify using simplify() command.
4. Write a MatLab program that calculates the following indefinite integrals. The program should ...
3. (a) Write a MatLab program that calculates for the function F(x, y) = ln(x + Va,2-y2) The program should use pretty) to display both the original function and the differentiated result, and also use fprintf() to print a label such as "F(x,y) -" and "dF/dxdy - " in front of both the function and the derivative. Then have your program also print out the derivative again after it uses simplify() on the result (b) Find the Taylor expansion of...
read instructions carefully please matlab only
Write a MATLAB function for a BMI calculator that receives the inputs for body weight (lbs)and height (ft) from the user's program, calculates the BMI using the equation below, displays the BMI category, and outputs the BMI value tothe user's program W (kg) h2 (m2) BMI Display Normal if 18.5 s BMI 25 Display Overweight if 25 s BMI <30 Display Obese if BMI 2 30 Else display underweight So you will create two...
THE CODE NEEDS TO BE ON MATLAB
2. Exercise (a) Let's write a script file that calculates exp(2) by a Maclaurin series using a while loop exp x )=-+-+-+-+ The while loop should add each of the series terms. The program error as defined below is smaller than 0.01. Error is the exact value (i.e. exp(2)), minus the approximate value (i.e., the current series sum) should exit the loop when the absolute absolute error-lexact-approx Use fprintf within the loop such...
(a) (4 points) Fill in the blanks in the following MATLAB function M file trap so that it implements the composilu trapezidul rulo, using a soquence of w -1,2, 4, 8, 16,... trapezoids, to approximatel d . This M file uses the MATLAB built-in function trapz. If 401) and y=() f(!)..... fr. 1)). 3= ($1, then the execution of z = trapz(x, y) approximates using the composite trapezoidal rule (with trapezoids). (Note that the entries of are labeled starting at...
Project DescriptionWrite a program that calculates the average number of days a company's employees are absent during the year and outputs a report on a file named "employeeAbsences.txt".Project SpecificationsInput for this project:the user must enter the number of employees in the company.the user must enter as integers for each employee:the employee number (ID)the number of days that employee missed during the past year.Input Validation:Do not accept a number less than 1 for the number of employees.Do not accept a negative...