Write a MATLAB function named top5_temps
Notes:
Write a MATLAB function named top5_temps The function will have one input and two return values...
Write a MATLAB function named my_calc • The function will have one input and one return value. • The first input, A, will be a list of numbers. The return value, M, will be a list of numbers. Each value of M must be calculated using the corresponding value of A according to this equation: M=Acos(30°)+5A3 Notes: • Example Test Case: A = [0.20 0.40 0.60 0.80 0.100 0.20]; M = my_calc(A); results in M = [0.2132 0.6664 1.5996 3.2528...
SQL PROGRAMMING
Exercises
Create a function named MyCube that will take a NUMBER
as in input and RETURN the cubed value of the input as a NUMBER. To
calculate the CUBE, multiply the input number by itself three times
(eg. num * num * num). Once you have the function created, test it
using the following SQL statement:
SELECT MyCube(3) FROM dual;
*The dual table is a built in table that you can use to
test your functions.
Create a...
1 write a Python function that takes in a list of integers and returns maximum and minimum values in the list as a tuple. Hint (can be done in one pass, you are not allowed to use built-on min and max functions.)max, min = find_max_min(my_list):2 write a Python function that takes in a list of integers (elements), and an integer number (num). The functions should count and return number of integers in elements greater than, less than, and equal to...
o Write a function that outputs even numbers less than the input number. • Function name should be 'evenprint'. • A number is given as input to the function. . The function must return a list of even numbers def evenprint(num): #write statement >[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74,...
In this problem, you should write one function named copy and increment. This function will have one parameter, which you can assume will be a list of integers. This function should return a copy of the parameter list, in which each number from the parameter list has been increased by 1. The function should not modify the values in the parameter list. For example, the code: values - 20, 40, 10, 60, 77, 2) other copy and incrementales) print values...
Python 3, nbgrader, pandas 0.23.4
Q2 Default Value Functions (1 point) a) Sort Keys Write a function called sort_keys, which will return a sorted version of the keys from an input dictionary Input(s): dictionary :dictionary reverse boolean, default: False Output(s): .sorted_keys: list Procedure(s) Get the keys from the input dictionary using the keys()method (this will return a list of keys) Use the sorted function to sort the list of keys. Pass in reverse to sorted to set whether to reverse...
Question #2 Write a function fun call that has two arguments: f, a function that has one argument that is a number and num.list that is a list of numbers. The command fun call(f, numlist) should produce a tuple that consists of the values obtained by applying the function f to each of the numbers in num.list in sequence. As an example, the command fun call (abs, [-1, 3, -4.5, 0]) should return the tuple (1, 3, 4.5, 0) since...
Lisp program count-of (symbol list): Write a function named count-of that takes two parameters, a symbol and a list. Count the number of instances of x in the list. Do not count the number of x in any sub-lists within the list. Test: count-of 'a '(a 'a(a c) d c a). Result: 2 trim-to (symbol list): Write a function named trim-to that takes a symbol and list as parameters. Return a new list starting from the first occurrence of the...
MATLAB 2019 The main function will have exactly one input and exactly one output. Using best practices, check the number of input arguments as well as the type of input. This function should only accept a vector (row or column). This also means that the value COULD be a scalar value. This function should accept scalars as well. The vector should be numeric, but can be any value: positive or negative, whole number or rational number. Throw a descriptive error...
Please write the code using matlab
1) i. Create an anonymous function named optimist, that accepts a single variable as input i Create a row vector Tthat represents the number of seconds in two minutes, starting ii. Call the function optimist on the vector T, store the result in variable R1 and returns the double of that variable from one and ending at a hundred and twenty v. Create an anonymous function named pessimist, that accepts a single variable as...