Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

What role does communication play in developing personal identity?

Answered: 1 week ago