`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
clear
all
clc
x=-10:0.01:10;
for i=1:numel(x)
if(x(i)<-1)
y(i)=20*sqrt(x(i))+6;
elseif(x(i)<5)
y(i)=8*x(i)*sin(2*pi*x(i));
else
y(i)=15*(x(i)-1)+1;
end
end
plot(x,y);
3. (a) Write a flow chart and the script file using for loop and conditional statements to evaluate and plot the folowing function, assuming that the salar x has a valiue: for x <-1 ys20yx + 6...
10) you will run/call the function with these given values. (b) Write a flow chart and the script file using conditional statements with logical operator if/else and if/elseif, to evaluate the following function, assuming that the scalar x has a value: y 2 sin(m) for-1 x < 5 y=10(X-5) + 1 for x 25 Use your file to evaluate y for x5,x 3 and x 15 by hand 10) you will run/call the function with these given values. (b) Write...
matlab only Question 5: a.) Write an m-file using conditional statements to evaluate the following function, assuming that the scalar variable x has a value. The function is for x <-1 - 3e y=2+cos(m) for-1 x<5 y 10-5)+1 for r 2 5 Use your file to evaluate y for x5, x-3, and x-15, and Use keyboard entry for values of x. b.) Use a for loop in the above file to plot the above function over the interval -2x <10....
Using MATLAB. Create a script file that calls a user-defined function within a for/end loop to symbolically compute the derivative of ln(x) on the interval from -5 to 5, containing 100 data points. Your script file should output a plot of the derivative of ln(x) (taken from your function) vs x. Use a line with circular markers for the plot and include a grid and appropriate labels. The user-defined function should 1. Receive a single x value as input. 2....
2. (aj An object thrown vertically with a speed vo reaches a height h at time t,where with a user defined function that computes the time required to reach a Write a MATLAB program specified height h, for a given value of vo. The function's imput should be h, we and g Testverurtrott" for the case where h-100 m, vee50 m/s and g-9,82 /by free hand. Write the MATLAB you will run/call the function with these given values (b) Write...
2. (a) An object thrown vertically with a speed vo reaches a height h at time t, where: he vot tgt Write a MATLAB program with a user defined function that computes the time required to reach a specified height h, for a given value of vo. The function's input should be h, Vo, and g. Test your function for the case where h 100 m, Vo-50 m/s and g9,81 m/s2 by free hand. Write the MATLAB command how you...
Use an anonymous function instead of a function file that calculates y(x) = sin(2x)( 4x2 + 3 ). Plot it using fplot, x goes from -8 to 8. Use your function to print out the value of y for x = -1.25 and x = 1.25. Deliverables: Script with anonymous function Plot using fplot Command window output Step by Step Instructions: Copy your calling script from Problem 1 Change the name of the function to be LabFcAnonymous (or something similar)...
Problem 1: Use MATLAB to create a script file and publish a pdf file for the problem: For x equal to 1.5 at intervals of 0.05 y = 6.25 +1.8 Create a rectangular plot of x&y. Submit the published pdf file. Problem 2: Use MATLAB to create a script file and publish a pdf file for the problem: Create a bar chart for Grade А B Students 48 37 29 2 6 D F Submit the published pdf file. Problem...
Only calculate manually 1. Write a short MATLAB script or function (m-file) that generates the functions (t)eu(t) for a = 0.1. Plot the value of x(t). Since the e-af almost attenuates to 0 after 5T, where T1. So make your time vector from 0 to 5T would be enough to capture the signal.) 2. Using the definition of the FT (1), manually calculate the FT of the given functions in previous exercise 0O x(t)e 3. Plot the absolute values and...
Flowcharts & for loops 1. Using a for loop, write a MatLab script to convert ounces to grams for 0 to 16 ounces, in 1-ounce increments. Present output in a table; label columns appropriately. 2. A Fibonacci sequence is composed of elements created by adding the previous 2 elements. The simplest Fibonacci sequence starts with 1, 1 and proceeds as follows: 1,1,2,3,5,8… Element 3 is the sum of elements 1 and 2 (1+1=2) Element 4 is the sum of elements...
1). For the function, f(x) X-4X+2XY+2Y2+2Y+14 a. Plot the surface function for X over [5 61, and Y over [-4,-2]," b. Draw the contour plot for X over [0 10], and Y over [-4,-2] and values for the contours 1.25 1.5 2 25 3 of V c. Write an m-file to find the minimum of the function using the gradient descent method. Use a starting value of [4,-4]. 1). For the function, f(x) X-4X+2XY+2Y2+2Y+14 a. Plot the surface function for...