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...
Program Description Write a program that calculates the distance between two places on Earth, based on their latitude and longitude. Prompt the user to enter the latitude and longitude of two places. The Earth’s mean radius is to be taken as 6371.01 km. Use user-defined variables with descriptive names wherever necessary. Following steps will have to be followed: Program must have header comments stating the author of the Program, date, and Program Description. Include the math.h header file Initialize a...
(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...
The following C++ code contains an incomplete program that should be able to calculate the distance between a series of geocoded locations. Two parts of the program need to be completed: 1. The portion of the main() function that calculates the distances between each of the hard-coded 5 locations, and stores it in a two-dimensional array declared as distances. 2. A portion of the calculateDistanceBetweenLocations(l1, l2) function; omitted code spaces are designed with a // TODO: comment. The code is properly...
WRITE IN PSEUDOCODE USING THE FOLLOWING GUIDELINES Classes Program 1: WAKA, WAKA. Pac-Man was a big hit back in the 80s. One of the things he could do was “teleport” from one side of the screen to the other, and that’s what we’re going to implement here. For this program, you’re going to write a class (called “PacMan”) that only has two attributes: an X and Y location. Imagine the player is on a 10x10 grid and starts at location...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...