Write a function that accepts an array a as input and

Assignment Help Mechanical Engineering
Reference no: EM13626384

Write a function that accepts an array a as input, and searches the contents of the array for elements in three different ranges: [0 - 10), [10 - 50) and [50 - 100]. The function builds three arrays that contain the elements from the a array that are in found in each range. These 3 arrays are the output arguments. For an input of a=[2 5 36 70 40 62 8],your program should return these three arrays

x = [2 5 8]

y = [36 40]

z = [70 62]

If the input has no elements in a specific range, the corresponding output array should be empty. If any element in a is greater than 100 or is negative, the program should display the element and the index where it is found using fprintf , and then use the error function to terminate the program. Make sure your program prints all the invalid elementsin the format shown before terminating it using error.

For example for an input of a=[2 5 36 70 40 102 8],your program should return,

The array has an invalid element 102 at index 6.

Reference no: EM13626384

Questions Cloud

A 228 kg mass connected to a spring completes one : a 2.28 kg mass connected to a spring completes one oscillation every three seconds. the motion has an amplitude of 1.5
Suppose a beam of 50 ev protons strikes a potential energy : suppose a beam of 5.0 ev protons strikes a potential energy barrier of height 6.0 ev and thickness 0.58 nm at a rate
Among 35-40 year olds 39 say they have operated heavy : among 35-40 year olds 39 say they have operated heavy machinery while under the influence of alchol. suppose three
Air flows at 120degc in a thin-wall stainless-steel tube : air flows at 120degc in a thin-wall stainless-steel tube with h 65 wm2 middot degc. the inside diameter of the tube is
Write a function that accepts an array a as input and : write a function that accepts an array a as input and searches the contents of the array for elements in three
An insulation system is to be selected for a furnace wall : an insulation system is to be selected for a furnace wall at l000degc using first a layer of mineral wool blocks
When the spring is loaded vertically with 1 kg weight it is : a spring with a wire diameter of 1mm and 20 turns of radius 10 mm was given to you. the weight of the spring is 4 g.a
A pro golfer can hit a ball at v240 fts and 9000 rpm to : the fluid dynamic characteristics of a golf ball are to be tested using a model in a wind tunnel. the dependent
The probability that a randomly selected 2-year-old male : the probability that a randomly selected 2-year-old male feral cat will live to be 3 years old is 0.88493 a what is the

Reviews

Write a Review

Mechanical Engineering Questions & Answers

  Package design

Package Design Brief: Assume you are the packaging engineer for a large consumer products company. In this company, the Packaging Design Briefs are initiated by the marketing group and forwarded to the Package Engineering group.

  Mechanical engineering questions

Define dynamic viscosity, Determine the centroid, Pressure due to the height of liquid, Advantage of changing the liquid, Calculate the total moment about the hinge of the seal gate.

  Automatic control

DOF system and Find the differential equation describing the system

  Write a paper on boyle''s law

Write a paper on Boyle's law and describe Compression and Combustion stroke . Also explain Charles's law and illustrate SI engine and CI engine.

  Verify the law for parallelogram of forces

To Verify the law for parallelogram of forces, law for triangle of forces and law of polygon of forces. These laws are very useful to calculate unknown forces in very short time.

  Discharge pressure of the compressor

What is the discharge revised discharge pressure of the compressor.

  The Case for Global Accounting Standards

The role of IFRS in both developing and developed capital markets.

  Wind turbine

Wind turbines are becoming more and more common as a method of energy production, wind turbines by their very nature are dynamic and are subject to and create their own internal and external kinematics and kinetics.

  Advanced design methodologies

8 x product engineering and design review (week 2 – 12), ~3 pages per item which must contain a brief description of the product then delve into concepts such as materials selection, manufacturing methods, life cycle analysis, recyclability and overa..

  Design of absorption column and the cooler

Design of absorption column and the cooler. Process design of other units should be completed along with pipe sizes.

  Determine the maximum total bending moment

Determine maximum total bending moment (static plus dynamic) of the beam under steady-state conditions.

  Force of the water on the gate

Determine the magnitude of the horizontal and vertical components of the force of the water on the gate.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd