Write a Matlab script to generate an array

Assignment Help MATLAB Programming
Reference no: EM132369444

Assignment -

1. Write a Matlab script to generate an array of 100 random samples between -5 and 5. The script should then copy the samples one by one to a new array, and check if they are within a limit range set between variables min and max, set at -2 and 2, respectively. If a sample is outside the range, it should be set to the limit value. Using the script, plot both arrays on the same figure.

2. Write a Matlab script to generate the plots of y = 5x2, where x is within [0, 10].

  • The step size of x in the first plot is 0.2.
  • The step size of x in the second plot is 0.5.
  • The step size of x in the third plot is 1.
  • The step size of x in the fourth plot is 2.

In the script, use the subplot command to display four plots on one figure.

  • Plot 1 should choose the red color.
  • Plot 2 should choose the blue color.
  • Plot 3 should choose the green color.
  • Plot 4 should choose the black color.
  • The point format in each plot should choose '+';.
  • The connection between dots should be dashed '--'.

3. Write a Matlab function that will accept an array of numbers. The function should sort the values from lowest to highest using two loops. Do not use the sort() or similar pre-made Matlab functions.

(Hint: one way to do this is a bubble sort algorithm. Use a "for" loop that repeats n-1 times, where n is the number of elements in the array. Within that loop, use another "for" loop that indexes through each element of the array (from 1 to n-1), compares it with the next highest element, and switches them if the first number is larger than the second.)

Reference no: EM132369444

Questions Cloud

Describe the management reporting systems and e-commerce : HI5019 Strategic Information Systems for Business and Enterprise Individual Assignment - Case Study - Rainbow Illusion. Describe the management reporting system
How do you plan the people working in the factory : How do you plan the people working in the factory? Think about various functions, organization chart. Who are your customers? Find targeted customers
Critical infrastructure and application of countermeasures : Conduct a literature review on emerging threats and challenges faced by the U.S. critical infrastructure and the application of countermeasures
Create five annotations for five different sources : How does it compare with other sources in your bibliography? How can you use this source in your research project? Has it changed how you think about your topic
Write a Matlab script to generate an array : Write a Matlab script to generate an array of 100 random samples between -5 and 5. The script should then copy the samples one by one to a new array
What demographic were the largest consumers of gangsta rap : How do you respond to this criticism? Why do you think this comparison to minstrelsy was made? What demographic are/were the largest consumers of gangsta rap?
Do you think the violence in hip hop lyrics is criticized : Do you think the violence in hip hop lyrics is criticized more than the violence in other forms of entertainment? If yes, why?
Write an analysis paper on drug policies in the united state : Describe the history of drug use and policy legislation in the United States. Write an analysis paper on drug policies in the United States.
What is the maximum power production of the system : MAE 204 Thermodynamics Assignment, University at Buffalo, USA. Given the information, what is the maximum power production of the system, in MW

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Matlab program to demonstrate common matrix operations

Write a Matlab program to demonstrate common matrix operations - Matrix addition and element by element multiplication and Matrix multiplication.

  Create from the stack a structure string stac

Design a structure stack that represents a stack of elements of some arbitrary type. Include the functions: create(returns an empty stack), push(add an element to the top of the stack and return the resulting stack), pop(delete the top element and re..

  Determine the tap settings of a three-tap

48771 - Discrete Communications - Complete the problem below AND use MATLAB to confirm your sketches, ensure you submit your MATLAB code and the plots it generates and what should be the tap parameters ai to make the resulting transfer function.

  Filtering – biomedical application

Prepare a filter that removes noise produced by electronic medical equipment.

  Developed a matlab code for multiobjective optimization

Developed a matlab code for multiobjective optimization checking if the developed results are good and optimum

  Predict flood area by using rainfall data

I need help with ANN (Matlab) to predict flood area by using rainfall data and some images that created by ArcGIS.

  One-dimensional steady-state heat flow

A one-dimensional steady-state heat flow, the mathematical formulation of problem - find out the temperature differences at each locations and calculate the temperatures at each locations

  Find the acceleration by taking the derivative again

We can find the acceleration by taking the derivative again.

  The function should compute and return

Define a function that takes as input parameters a function handle f, start and end values a and b, and a number of steps n. The function should compute and return the x and y values of the maximum of the function over the range a to b.

  Load the handel sound file in matlab

Load the handel sound file in MATLAB and add the preceding three sinusoidal signals to create a corrupted sound signal-Design an IIR filter using notch filter

  Calculate the geometric mean of numbers

Write a program to calculate the geometric mean of numbers entered by a user. The program should prompt the user to enter numbers and continue to accept the numbers until the user enters 999.

  Write a function called halfsum

Write a function called small_elements that takes as input an array named X that is a matrix or a vector. The function identifies those elements of X that are smaller than the product of their two indexes

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