Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRITE MATLAB PROGRAM Create a function called histogram that returns an array containing the histogram of a data set that is passed to the

PLEASE WRITE MATLAB PROGRAM

image text in transcribed

Create a function called histogram that returns an array containing the histogram of a data set that is passed to the function. Write the algorithm yourself: do NOT use the MATLAB function hist * Your function should accept four parameters: max, min, Nbins and the input data vector. o max: upper edge value of the largest bin (note: this value is independent of the actual maximum value of your data); min: lower edge value of the smallest bin (note: this value is independent of the actual minimum value of your data); Nbins: the number of data bins to display. Given these parameters, set o o max- min AbinNbins o the input data vector. Your function should return the histogram vector of length Nbins In the event your input data falls outside of the available range, increment the nearest edge bin. For example, assume that you have specified a max of 10 but vou encounter a value of 11-vou are then to increment the bin that has 10 as the upper edge value, * You should normalize your histogram result such that the total "area" under your histogram is one (like a PDF). Hint: what normalization factor would you choose if all of your data belonged to a single bin (i.e., divide by the area of the bin, which would be the height or number of input points times the width of the bin)? Your function should include error checking

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

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Define marketing concepts.

Answered: 1 week ago

Question

1 what does yellow colour on the map represent?

Answered: 1 week ago

Question

Know how productivity improvements impact quality and value.

Answered: 1 week ago

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago