Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The built in MATLAB function MAX (and MIN) will determine both the location and value of the maximum (and minimum) element in an 1 times

image text in transcribed

The built in MATLAB function MAX (and MIN) will determine both the location and value of the maximum (and minimum) element in an 1 times n array. Write a MATLAB script which performs this task from scratch (i.e. you may not use the built in max or min functions). Have your script first prompt the user for the length of the array and then individually prompt him/her for the n numbers exactly as demonstrated below. Then have your script display to the screen the maximum value in the array and the index location. Output should (with the difference of user input) EXACTLY look like the following: Please enter your name == > Jeff Jeff, please enter how many numbers you have == > 4 Please enter number 1. Jeff == > 6 Please enter number 2 Jeff == > 7 Please enter number 3 Jeff == > 4 Please enter number 4 Jeff == > 5 The largest element 7 was found in location 2 The smallest element 4 was found in location 3

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

Define Coupon in relation to bond terminology

Answered: 1 week ago

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago