Question: I need all questions done using Matlab, plz write comments for explanation. thx 3. Write a script which asks the user for a number n
I need all questions done using Matlab, plz write comments for explanation. thx 3. Write a script which asks the user for a number n and generates a matrix of dimensions n n in which each element is either 0 or 1, arranged in a checkerboard pattern, as below, for n 4: [1 0 1 01 0 1 0 1] 4. Write a function which takes as parameter a vector of 3 elements and returns another vector with the same elements, but in decreasing order. 5. Write a script which prints out the following numbers in a pyramid, using loops: 9999 .9999 6. Write a script which asks the user to input numbers until the user inputs 0. The script should then print the sum of all the numbers entered. 7. Write a function which takes a matrix as parameter and outputs the product of the numbers on the secondary diagonal, i.e. the one going from bottom-left to top-right. 8. Write a function which reverses a vector, i.e. if the input is [4, 2, 1,5,-3], the output would be [-3,5,1,2,4. 9. Write a function which computes the sum of every second element in a vector. 10. Write a function which finds a local minimum in a vector, which is not the global minimum. A local minimum is an element in the vector which is larger than its two neighbours. 11. Write a function which takes as input a vector of length n2 and outputs a matrix of dimension n n with the same elements, filled in line by line. For instance, for v [1,2,3,4,5,6, 7,8,9], the output should be A 4 5 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
