Write a MATLAB function to calculate the electromagnetic force F between two charges (Q1,Q2) placed (in vacuum) at a distance R from each other. The function takes three input argument R, Q, and Q2 and return one output argument F.
Q: Write a MATLAB program to plot the curve sin“(x)+cos“(x) given x = 0:0.01:2*pi.
A: MATLAB program to plot curve Sin4(x)+cos4(x) where x = 0:0.01:2*pi
Q: Write a Matlab program to plot the trigonometric function given below: y(t) = 2sin3(t) - 4cos2(t)…
A: Write a Matlab program to plot the trigonometric function given below: y(t) = 2sin3(t) - 4cos2(t) +…
Q: Q4] (10 Marks) Write a MATLAB code for computing the following .functions
A: It is defined as a script which contains a set of commands exactly as you would type them at the…
Q: Create a MATLAB program using the ideal gas law P=N R T/V. Use input command to input variables:…
A: 1. get input form user using prompt. 2. compute P from given formula 3. output p and formatted in…
Q: Write a MATLAB program to plot the curve of the function tan3(x), given x = -2*pi:o.01:2*pi. Attach…
A: The answer given as below:
Q: Write a MATLAB code to get the series solution of the differential equation a²y (x2 – 1)+x + y = 0…
A: Normally dsolve() gives solution to a differential equation. Inorder to get series solution of…
Q: Write a MATLAB program to verify the trigonometric identity given below: 2 sin20 = 1- cos 20 Take 0…
A: To verify the given identity we have to plot the curve of both L.H.S i.e. 2sin2θ and R.H.S. 1 -…
Q: Write MATLAB program to take input Height and Base radius of a hollow cylinder and print the surface…
A: Algorithm : Step 1 : ask for the height from the user. Step 2 : ask for the radius from from the…
Q: • Q/ Given the surface charge density, ps =2.0 µC/m² , existing in the region p <1.0 m, z = 0, and…
A: The answer as given below:
Q: Q.5 For the system shown below, write a MATLAB program to plot the force in members AB and BC for 30…
A: MATLAB Script in text % Clear the command window, workspace variables & close all open…
Q: Write a MATLAB program to plot the curve of the equation given below, take x = 0:0.01:1. z(x) = 3x2…
A: Write a MATLAB program to plot the curve of the equation given below, take x = 0:0.01:1.z(x) = 3x2 -…
Q: e) Write a MATLAB program to plot a circle with unit radius and center at origin(0,0). Attach code…
A: Write a MATLAB program to plot a circle with unit radius and center at origin(0,0). Attach code and…
Q: Write a MATLAB program that used to calculate the following series
A: % user defined function function output = sin_x(x) % taking x as parameter for n = 0:100 % nterate…
Q: Write a Matlab code to plot the function y=cos(z) in the range from 0 to 2π.
A: PROGRAM CODE: The range of the value for the variable x is from 0 to 2pi. The difference between…
Q: Write a MATLAB program to calculate the following expression and round answers to the nearest…
A: Given :
Q: 4. Write a MATLAB program to plot the curves of the functions y1 = 2*sin(x)*cos(x) and %3D y2 =…
A: Given that y1 = 2* sin(x)*cos(x) y2 = 4*cos²(x)
Q: construct a MATLAB function to apply the formula (y = e³x + 2√√4x) for any input value:
A: We need to write a MATLAB program to take an input from user and calculate the result for given…
Q: 4. Write a MATLAB program to plot the function z = sin “(x) - cos“(x). x = 0:0.01:2*pi. Attach the…
A: Write a MATLAB program to plot the function z = sin4(x) - cos4(x). Given, x = 0:0.01:2*pi. Attach…
Q: Write Matlab code to plot the unit-ramp function in MATLAB. z(t) = t, if t>=0 z(t) = 0, otherwise. t…
A: Write Matlab code to plot the unit-ramp function in MATLAB. z(t) = t, if t>=0 z(t) = 0,…
Q: Write the MATLAB program required to generate each of the following signals:
A:
Q: 22. Write a MATLAB program to plot the curve of sin°(x) + sin (x) given x = 0:0.01:2*pi. %3D
A: Write a MATLAB program to plot the curve of sin5(x) + sin4(x) given x = 0:0.01:2*pi.
Q: Express the following mathematical expression in MATLAB form: d. cot(t)
A: clc; t = 30 cot(t) Screen Shots:
Q: Write a Matlab program to plot the curve of the equation y(t) = t3 + 2t -3. Given: t = 0:0.01:10…
A: Write a Matlab program to plot the curve of the equation y(t) = t3 + 2t -3. Given: t = 0:0.01:10.
Q: Use Matlab to plot the function range 0<x<3 and -3<x<6 f(x) = (x + 1)(x + 2)(2x -0.25) - e*,
A: We need to generate the plot for above function. See below steps for code and output.
Q: 4. Write a MATLAB program to plot the curves of the functions y1 = 2*sin(x)*cos(x) and y2 = 4*cos…
A: Matlab program to plot the curve of the function y1=2*sin(x)*cos(x) x = linspace(0, 2*pi, 100); fx…
Q: Write a MATLAB function to calculate the electromagnetic force F between (Q1. Q2) placed (in vacuum)…
A: The function lets call it ElecForce receive 3 arguments and then compute the force using the given…
Q: Write a MATLAB program to take input height of cylinder h and radius of base r from user and print…
A: Given: A figure is given in which a hemisphere is mounted over a cylinder with height h and radius…
Q: Write the equations in MATLAB language y=x^3-2x^2+x-4 -4≤x≤4
A: Input : Vector: x Output : Value of expression : y
Q: Write a MATLAB program to plot the curve of the function tan³(x), given x = -2*pi:0.01:2*pi. Attach…
A: The complete code in Matlab is below:
Q: 3. Write a MATLAB program to plot the curve of the equation f(x) = x² - x - 12. Given: x =…
A: Write a MATLAB program to plot the curve of the equation f(x) = x2 - x - 12. Given: x = -5:0.01:5.
Q: Q1: Write a MATLAB program to plot the function: 5 sin(x) 3x f(t) = for -5 <xs10 . 5 r+e-0.75x
A: Please post remaining question again because answering more than one question is against our policy.…
Q: The following function is written in * :Matlab code as (ln(x) + 1)² (x - 1)³ y = +x
A: We need to write the given function using Matlab.
Q: Task # 1: Write a Matlab code that generates Delta (Impulse) Function.
A: A range is created from -10 to 10 with step size of 1. A variable val has been created with value…
Q: 5. Write a MATLAB program to plot the curve of the equation f(x) = x2 - 2x - 48. Given: x = -10:…
A: Write a MATLAB program to plot the curve of the equation f(x) = x2 - 2x - 48. Given: x = -10: 0.01:…
Q: Write a MATLAB code to input the radius r of a circle and plot the circle with the radius r in the…
A: Write a MATLAB code to input the radius r of a circle and plot the circle with the radius r in the…
Q: Write a MATLAB script to obtain the figure below for 0 s *S 2n sine function 1.5 0.5 0.5 -1 -1.5 -2…
A: Provided the Matlab script with appropriate comments as shown below in order to obtain the above…
Q: Write a MATLAB program to solve this equation (using function) Z=(3S+2.5)/(C-B)
A: Code: S = input('Enter the value of S: '); C = input('Enter the value of C: '); B = input('Enter the…
Q: Write MATLAB program to find the period of sine wave. Given the period of sine wave lies in range 0…
A: We have to find the period of sine wave using a MATLAB program and we are given that period lies in…
Q: e) Write a MATLAB program to plot the curve of the quadratic equation x2 - 5x + 6 = 0. Take the…
A: Write a MATLAB program to plot the curve of the quadratic equation x2 - 5x + 6 = 0. Take the domain…
Q: Write a MATLAB program to plot the curve of the quadratic equation x 5x + 6 = 0 and find whether…
A: We need to write a MatLab code that plots the curve of x^2-5x+6=0 and to check if the roots lie in…
Q: e) Write a MATLAB program to plot the curve of the function f(x) = sin°(x). x = 0:0.01:2*pi.
A: Write a MATLAB program to plot the curve of the function f(x) = sin3(x). x = 0:0.01:2*pi.
Q: Write a MATLAB function to obtain the roots of the following quadratic equations: (a) x2 + 3x + 2 =…
A: Create a vector to represent the polynomial, then find the roots.
Q: Write a MATLAB program to plot the curve of z(x) = tan(x) + cot(x). Given x = 0:0.01:2*pi. Attach…
A: Write a MATLAB program to plot the curve of z(x) = tan(x) + cot(x). Given x = 0:0.01:2*pi. Attach…
Q: Write a Matlab program to read the values of variable x,y and print the value of tan(x) + tan-1(y)…
A: Required:- Write a Matlab program to read the values of variables x,y and print the value of tan(x)…
Q: Write program of the Matlab Print and plot X < 1 1 + 1/X X 21. f(x) = 5x + 1
A: The following are steps need to be taken for the given program: Defining the vector x for domain…
Q: Write a matlab code and run the program attach the output.
A: Matlab code: clc ;%% clear all the command line clear all ;%% clear all the previous variables close…
Q: Write Matlab code to plot the function 2*sin (x),
A: The answer is
Q: Write a MATLAB program to plot the curve of the quadratic equation x - 7x + 12 = 0. X = -10:0.01:10.
A: Write a MATLAB program to plot the curve of the quadratic equation x2 - 7x + 12 = 0. Given: x =…
Q: 3. Write a MATLAB program to print the A.P. series for the given values of a,d,n given below: First…
A: Write a MATLAB program to print the A.P. series for the given values of a,d,n given below: First…
Q: Write a MATLAB program to read input the height(in cm) and radius (in cm) of a cylinder and print…
A: Write a MATLAB program to read input the height(in cm) and radius(in cm) of a cylinder and print the…
Step by step
Solved in 3 steps with 1 images
- (Numerical) Heron’s formula for the area, A, of a triangle with sides of length a, b, and c is A=s(sa)(sb)(sc) where s=(a+b+c)2 Write, test, and execute a function that accepts the values of a, b, and c as parameters from a calling function, and then calculates the values of sand[s(sa)(sb)(sc)]. If this quantity is positive, the function calculates A. If the quantity is negative, a, b, and c do not form a triangle, and the function should set A=1. The value of A should be returned by the function.(Practice) For the following function headers, determine the number, type, and order (sequence) of values that should be passed to the function when it’s called and the data type of the value the function returns: a. int factorial(int n) b. double volts(int res, double induct, double cap) c. double power(int type, double induct, double cap) d. char flag(char type, float current, float time) e. int total(float amount, float rate) f. float roi(int a, int b, char c, char d, float e, float f) g. void getVal(int item, int iter, char decflag, char delim)Write a function that implements the quadratic equation. Given three inputs (a, b, and c), calculate the roots (r1 (+) and r2 (-)) of the quadratic formula. Review 19 Write a function that implements the quadratic equation. Given three inputs (a, b, and c), calculate the roots (r1 and r2) of the quadratic formula. Call your function Roots a = 1 b = 2 c = -3 [r1,r2]=Roots(a,b,c)
- Please Solve this Question using C++99 Version of C plus. Problem 1 (Numerical Differentiation) The altitude (ft) from the sea level and the corresponding time (sec) for a fictitious rocket were measured as follows: Time Altitude 0 400 10 20 9200 30 40 45640 50 87370 60 70 80 90 100 160100 62070 97360 103430 127900 149630 23840 a) Use the skeleton program below. Write a function (CENTRAL) to numerically compute the velocity from the table above using the central difference scheme. Use equation (18) in the lecture note (14-Numerical Differentiation.pdf) at t=100 and use the equation below at t = 0. Make sure that you attach example runs showing the results from the computer. f(x)~ 4 f(x+h) -f(x+2h) -3 f(x) 2 h b) In the same program, write two functions (FORWARD and BACKWARD) to compute the velocity using the forward and backward difference scheme. c) Output your results in a table comparing the velocity using the…Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the results in main(). Y c program h....17. A function should determine the average of x and y. What should be the function's parameters and return value(s)? A.Parameters: none Return values: X,y B.Parameters: ×, y, average Return value: none C.Parameters: average Return values; X, y D.Parameters: X, y Return value: average
- 12.a. Write a function inside(x,y,x1,y1,x2,y2) that returns True or Falsedepending on whether the point (x,y) lies in the rectangle with lower left corner(x1,y1) and upper right corner (x2,y2).>>> inside(1,1,0,0,2,3)True>>> inside(-1,-1,0,0,2,3)Falseb. Use function inside() from part a. to write an expression that tests whether thepoint (1,1) lies in both of the following rectangles: one with lower left corner (0.3,0.5) and upper right corner (1.1, 0.7) and the other with lower left corner (0.5, 0.2)and upper right corner (1.1, 2).Write a function that receives 5 integers and returns the sum, average and standard deviation of these numbers. Call this function from main() and print the results in main().Find the error # Display the powers of 2 using anonymous function terms = 10 # Uncomment code below to take input from the user # terms = int(input("How many terms? ")) # use anonymous function result = list((lambda 2 ** x, range(terms))) print("The total terms are:",terms) for i in range(terms): print("2 raised to power",i,"is",)
- Define a function print_feet_inch_short(), with parameters num_feet and num_inches, that prints using ' and " shorthand. End with a newline. Remember that print() outputs a newline by default. Ex: print_feet_inch_short(5, 8) prints:5' 8" Hint: Use \" to print a double quote. ''' Your solution goes here ''' user_feet = int(input())user_inches = int(input()) print_feet_inch_short(user_feet, user_inches) # Will be run with (5, 8), then (4, 11)a function should convert a from the function a Fahrenheit temperatures (F) to a Celsius temperatures . what should be the out put from the function? F and C, F and 32 , F only, C only6. use c ++ to Write a function sumDigits, that accepts a positive integer n and returns the sum of the digits in that integer; thus, sumDigits(34) would return 7 (e.g., 3+4). Use the techniques from the roman numeral problem to extract the digits.