x - 6x+ 5 S(x) =- x-3 Q2. Create an anonymous function: and variable * that has 200 points over the range -25x58. Plot x vs. f(x) on the screen.
Q: What is the reduced form of the function F = X(X+Y)+X(X+Y) а) Y b) X с) 0 d) 1
A: As requested no explanation is provided. The answer is given below
Q: Consider the following function shoots: def shoots(x: int) -> int: 2 if x <= 0: 3\ return 0 4 elif x…
A: We are given a recursive function and we are given few statements for it, we need to pick the…
Q: Templatize the fibonacci( ) function on the type of value that it produces (so it can produce long,…
A: template<int N, typename T = int>struct fibonacci { static constexpr T value =…
Q: Q1: Let A = {a, b}, B = {e} and C = {d,e}, find (A x B) x (B x C)? %3D
A: A={a,b} B={e} and C={d,e} Find (A×B)×(B×C) Cross product of two sets will form the ordered pairs.…
Q: The function f(x) = x^3 is bijection from R to R. Is it True or False? O a. True O b. False
A: Bijection: If two sets A and B are bijective, then they are finite sets and also have same size. To…
Q: WHite a Ct function which takes a integer as þarom ter and neturn x - int 1square (int x) j
A: Write a C++ function which takes a integer x as input parameter and return the square of that…
Q: Q2. Write a forward pass function forward (x, w, b, func) to calculate variables z, y, given X, O…
A: Input : Values of x, w, b, and func. Output : Value of z, yhat, and L.
Q: Q2 / A/ plot the function Z = 3 (1- х)'е - х?- (у+1) 2 -10х - х* - у5) е - х? - у? -е- - y? 3 where…
A: Since no programming language is mentioned, I am using Matlab. Code: x=-3:3; y=-3:3;…
Q: We can assign a value to each character in a word, based on their position in the alphabet (a = 1, b…
A: Answer: Algorithms: Step1: we have create balance function to takes arguments as string Step2: we…
Q: n the function XZ̅ + Y, if X is false, Z is false, Y is true then the whole statement is False…
A: Answer : XZ' + Y , Here in this function if X is false which means 0. Z is false which also means…
Q: 4- By using functions write a complete program that's reads a real value representing price and…
A: As you have not specified programming language i have written it in c programming language.…
Q: Write a program to Plot a four (4) function of x (in a separate plot) , where: y1= sin(3x), y2 = cos…
A: Four different plot of x is given below for the following four functions in the interval [1,4]…
Q: Functions Example Write a function + double Formula1(int m, int n) + double Formula2(double x) m= 9…
A: Code #include <iostream>#include<math.h> using namespace std; double formula1(int…
Q: Create a function that finds the maximum range of a triangle's third edge, where the side lengths…
A: Program Description : We need to find out the third edge of triangle using the two other edge.So,…
Q: Q2/Write a program that reads from the user the value of x and apply the function below: * x+4 x-3+…
A: Code in c++ as you have not mentioned the coding language providing the code in c++: #include…
Q: HW7_2 This problem uses an interpolating polynomial to estimate the area under a curve. Fit the…
A: Actually, program is an executable software that runs on a computer.
Q: Q2/Write a program that reads from the user the value of x and apply the function below: 1 11.5 > x…
A: C++ program for above : #include <bits/stdc++.h> using namespace std; //function to…
Q: Assuming that you have the functions "drawPolygon(int|] x, y, int n)" for drawing polygon,…
A: For generating the question diagram, these function calls would be made as we just need to call the…
Q: If a data looks like this, what type of function do you expect to fit it best? 20 15 10 5 0 0.0 0.5…
A: C. y=1-exp(ax+b)
Q: If x_0=5 and x_n=3x_(n-1) mod 150 a) Write a function R to generate 1000 pseudo random numbers based…
A: Pseudo-Random Number Generator: A pseudo-Random Number generator is refer to an algorithm that…
Q: We can assign a value to each character in a word, based on their position in the alphabet (a = 1, b…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: Find the maximum value of the function 2x²+3x+20 where parameter x varies between 10 to 25…
A: The maximum value of function 2x2+3x+20 is 1345.
Q: x3 is O(g(x)) for each of the ff. functions g(x) EXCEPT O g(x) = 3* O g(x) = x° O None of the…
A: Solution: Given,
Q: What is the reduced form of the function F X(XY)+X(X+Y)? a) Y b) X c) 0 d) 1
A: Reduction:The reduced form of the function “F” is computed as follows:
Q: This is a reverse coding challenge. Create a function that outputs the correct field from the input.…
A: 1. Create the Method with String as an argument 2. create the new array with the name arr. 3.…
Q: Write a program which prints the following message in the output screen by using In and \t…
A: Given, A program which prints the given message in the output screen by using \n and \t functions.…
Q: Q11/ Write a program that provides the user with the possibility to draw one of the following…
A: Note: programming language not mentioned in the question. C++ is chosen as a programming language…
Q: polean function F(A.B.C,D) represented by Em0,m2,m8,m10,m14) + d)m5,m15 can be written in optimized…
A:
Q: Create a function that scales,
A: def scale_analog_input(In_value, Inn_Min, Inn_Max, Ut_Min, Ut_Max): Ut_value = ((In_value -…
Q: Create a function that finds the maximum width of the third edge of the triangle, where the lateral…
A: In the above problem, we need to create a method nextEdge with two argument. logic - if(side1 >…
Q: Create a function that loops from 1 to 30 and prints out each value on a separate line, except print…
A: Given: Create a function that loops from 1 to 30 and prints out each value on a separate line,…
Q: Create a function that takes a string and outputs true if the string’s first three letters start…
A: string-prefix in Racket The function named string-prefix? in racket checks whether the string…
Q: Implement the following function using? a)8x1 MUX b)4x1 MUX F=ABC'+A'BC'+A'BC+AB'C
A:
Q: Q3: Make two plots of the function: F(x)=(x+1) (x-2) (2x-0.25)-e*, One plot for 0<x<3 and one for…
A: Q3. Code: x=0:3;f= @(x) (x+1).*(x-2).*(2*x-0.25)-exp(-x)plot(x,f(x))hold on…
Q: find F(f(x),g(x),h(z)) if f(x,y,z)=yexyz,f(x)=x2,g(y)=y+1 and h(z)=z2
A: Given f(x)=x2 g(y)=y+1 h(z)=z2
Q: What is the reduced form of the function F = X(X+Y)+X(X+Y)? а) Y b) X c) 0 d) 1
A: The answer to the following question can be easily solved by using some reduction laws . Our…
Q: Write a DECIMATOR function that takes a unit of character and minimizes it (i.e. removes the last…
A: Given a string/characters x of size n Removing 1/10th of the character from end of x i.e. n/10…
Q: 2. Let f(x) = e*/7 sin(x + 3) for 0 < x < 10. Using any commands, find all critical points and…
A: Code: syms x f = exp(x/7)*sin(x+3); %plotting function fplot(f) hold on f1 =…
Q: Write an inline function to compute the perimeter of a rectangle of length l and width w (both l and…
A: inline int perimeter(int l, int w){ return 2*(l+w);}
Q: Create an anonymous function which accepts a vector valued numeric input (from x=1 to x-10 with 0.5…
A: x = 1:0.5:10; % create vector from 1 to 10 with step of 0.5 % anonymous funciton f(x) which is equal…
Q: Q2/Write a program that reads from the user the value of x and apply the function below: 11.5 > x >…
A: As you have not mentioned the language i am providing the code in c++: #include…
Q: TASK 1: Swap Brightest and Darkest Colors (15 – 20 min) Create a function LightDark which identifies…
A: answer
Q: Write a program to calculate the B power of Afor non-negative value of B. A" = Ax Ax A...xA Without…
A: Programs: Programs are the implementation of the algorithms using the programming languages.…
Q: True or False? 14. Consider the function f : D → C where A, B ⊆ D. If f[A] − f[B] = ∅ then f[A − B]…
A: false
Q: Define a function that converts C to F degree. Then compute the Fahrenheit degrees for the following…
A: Code :
Q: Re-write the following function so that a given XAND return the value of f(x).
A: logical error:- brackets were missing. as per the priority, *, / has same priority and…
Q: What do you call a function that assigns a unique real number to each element in the sample space?…
A: The sample space associated with a random experiment is the set of all possible outcomes.
Please help me code question 2 in matlab. Thank you.
Program Plan:
- Declare an anonymous function
- Create a vector to store the 200 points between range -2 to 8.
- Finally, plot the function.
Step by step
Solved in 4 steps with 2 images
- Pb#1: For several values of x, confirm that eix = cos x + i sin x Pb#2: An object thrown vertically with a speed vo reaches a height h at time t, where h= vo*t - gt2 Write and test a function that computes the time t required to reach a specified height h, for a given value of vo. The function's inputs should be h, vo, and g. Test your function for the case where h=100 m, vo=50 m/s. and g=9.81 m/s2. Interpret both answers. (MATLAB)Answer this question in JavaScript: Use the weather data set that's provided in the code var weatherData = [ { 'location': 'Paris', 'temp in C': 27.1, 'wind in kph': 38.4 }, { 'location': 'Nairobi', 'temp in C': 38.2, 'wind in kph': 3.5 }, { 'location': 'San Francisco', 'temp in C': 15.7, 'wind in kph': 12.8 }, { 'location': 'Tokyo', 'temp in C': 20.4, 'wind in kph': 8.8 } ]; Write a function to output a temperature graph like: Paris @@@@@@@@@@@@@@@ 27.1 Nairobi @@@@@@@@@@@@@@@@@@@@ 38.2 San Francisco @@@@@@@@ 15.7 Tokyo @@@@@@@@@@ 20.4 You should also write a function that produces a similar graph, but verticaA = 3 B = 6 C = 9 D= 7 mod10(X) is a function that returns the modulus of X after dividing it to 10. abs(X) is a function that returns the absolute value of X. Examples: mod10(6) = 6, mod10(16)=6, mod10(0) = 0, mod10(15)=5, mod10(41)+12 = 13 abs(4-8) = 4, abs(8-4)=4, abs(2-9) = 7, abs(8-1) = 7, abs(4-4)=0, abs(2-9)+8 = 15 Calculate the following: K1 = mod10(A+B) + 1= ……. K2 = abs(C-D) + 3 = ……. K3 = abs(D-2) + 1 = ……. K4 = mod10(A+B+C+D) + 1 = ……. K1 = mod((A+B), 10) + 1; K2 = abs(C-D) + 3; K3 = abs((D-2)) + 1; K4 = mod((A+B+C+D),10)+1;
- Write a Matlab function that will: read in the spreadsheet file, accept two textual/string arguments: first metric abbreviation/acronym (for example GP) from the list above, Second metric abbreviation/acronym (for example 3P%) from the list above, finds the player (A) who has the highest/maximum value of the FIRST METRIC (if there is more than one with that value, pick the first one - lowest row number) and stores his name and corresponding FIRST METRIC value, finds the player (B) who has the lowest/minimum value of the FIRST METRIC (if there is more than one with that value, pick the first one - lowest row number) and stores his name and corresponding FIRST METRIC value, computes FIRST METRIC average for all players, finds SECOND METRIC value for both players found above, computes SECOND METRIC average for all players,Interesting, intersecting def squares_intersect(s1, s2): A square on the two-dimensional plane can be defined as a tuple (x, y, r) where (x, y) are the coordinates of its bottom left corner and r is the length of the side of the square. Given two squares as tuples (x1, y1, r1) and (x2, y2, r2), this function should determine whether these two squares intersect, that is, their areas have at least one point in common, even if that one point is merely the shared corner point when these two squares are placed kitty corner. This function should not contain any loops or list comprehensions of any kind, but should compute the result using only integer comparisons and conditional statements. This problem showcases an idea that comes up with some problems of this nature; it is actually far easier to determine that the two squares do not intersect, and negate that answer. Two squares do not intersect if one of them ends in the horizontal direction before the other one begins, or if the same…Consider the PreviousDate() function. This function takes three parameters month, date, and year as inputand returns the date of the day before. For example if the input is month = 4, day = 23, year = 1989, theoutput will be 22-04-1989 (or April 22, 1989). The 3 inputs are integer values and with followingconstraints:1 ≤ month ≤ 12, 1 ≤ day ≤ 31, 1712 ≤ year ≤ 2112Design test cases based on boundary value testing.
- Write a Matlab function called that will: read in the spreadsheet file, accept two textual/string arguments: first metric abbreviation/acronym (for example GP) from the list above, Second metric abbreviation/acronym (for example 3P%) from the list above, finds the player (A) who has the highest/maximum value of the FIRST METRIC (if there is more than one with that value, pick the first one - lowest row number) and stores his name and corresponding FIRST METRIC value, finds the player (B) who has the lowest/minimum value of the FIRST METRIC (if there is more than one with that value, pick the first one - lowest row number) and stores his name and corresponding FIRST METRIC value, computes FIRST METRIC average for all players, finds SECOND METRIC value for both players found above, computes SECOND METRIC average for all players.Define a function which takes one parameter N, and use loop(s) to control and output a pyramid pattern as follows: print a total of N rows, the number of asterisks in each row equals the row number (e.g. the 1st row has 1 asteroid, the Nth row has N asteroids). Note the pattern should be center aligned. E.g. when N is 5, you will print the following pattern * * * * * * * * * * * * * * *Write the C equivalent “train” function #void train(int*A, int*B, int*C, int k) train: add $t4, $0, $0bus: add $t5, $t4, $a1 lw $t6, 0($t5) add $t5, $t4, $a2 lw $t7, 0($t5) add $t6, $t6, $t7 add $t5, $t4, $a0 sw $t6, 0($t5) addi $t4, $t4, 4 slt $t5, $t4, a3 bne $t5, $0, bus jr ra
- Q14) Consider the definition of the function foo below. Assuming that the next function call to foo would pass the string "#1,2,3,4,5,6,7,8,9,10#" (without the quotes) to the parameter y, then which value would need to be passed to foo as the parameter x in order for the return value to be 3 0 1 2 3 4 5 6 7 8 9 10 None of these optionsWrite a function that receives 3 assignment grades, a1, a2, a3, and a final grade, f, for a student and returns the corresponding letter grade of the student. The weights for the assignments and the final are 0.2, 0.2, 0.2, and 0.4, respectively. You can use the following table for matching grades to letters: 95-100 -> A1 90-94 -> A2 85-89 -> A3 80-84 -> B1 75-79 -> B2 70-74 -> B3 65-69 -> C1 60-64 -> C2 55-59 -> C3 40-54 -> D 0-39 -> F For example, compute_letter(80, 60, 40, 70) returns "C2" because 80 * 0.2 + 50 * 0.2 + 40 * 0.2 + 70 * 0.4 = 62 and 62 corresponds to C2. Note that, you are expected to do rounding. For example, 39.4 is F, whereas 39.5 is D. You can use the builtin round() function for this. Please google this function and learn how to use it. """For 8 bits floating point representation using: seeeffff, what is the bias for normalized numbers? For 8 bits floating point representation using: seeeffff, what is the bias for normalized numbers? Question 69 options: A. 7 B. 6 C. 4 D. 3 E. 2 Which statement is true about static binding? A. the binding of a function call and the function definition occurs at compile time B. the binding of a function call and the function definition occurs at run time C. the binding of the type of a variable and the variable name occurs at run time D. the binding of the type of a variable and the variable name occurs at compile time