Write a while loop that will display the odd numbers

Assignment Help MATLAB Programming
Reference no: EM132093986

Please answer all of these MATLAB questions.

1) Variables are used to store data in the computer. All variables have a type that specifies what kind of data the variable contains. Create 5 new variables ( one for each basic data type) and give them a value.

2) Given a variable answer, write one line of code that produces true if the answer is either 'y' or 'n' and false otherwise.

3) Create a random floating point number between 10 and 50. Store this number in a variable named my_float. Create a random integer between -10 and -50. Store this number in my_int.

4) Write a while loop that will display the odd numbers from 7 to 21.

5) Write code to ask the user to enter a color (as a string; valid colors are 'red', 'yellow', 'blue'). Keep asking until a valid color is entered.

6) Write the function is_array_odd() that takes in an array and returns true if values in the array are odd, and false otherwise.

7) Write the draw_line() function. It should take in a line, and plot the line on the screen. The draw_line() function should optionally allow the user to pass in a color. If so, draw the line in that color, if not, draw the line in red.

Reference no: EM132093986

Questions Cloud

Issues in marketing professional services : Bloom and Dalpe (1993) discuss some issues in marketing professional services. What are some of the marketing concepts involved in this article?
Describe a method for combining t1 and t2 into a binary tree : Describe a method for combining T1 and T2 into a binary tree T, whose nodes hold the union of the entries in T1 and T2 and also satisfy the heap-order property.
Trade logistics performance of member countries : Links to an external site. which provides a ranking of the trade logistics performance of member countries
Prepare a report on this focal problem : BLD831 Assignment - You need to prepare a report on this focal problem that includes the following: Clinical background and Genetic code
Write a while loop that will display the odd numbers : Write code to ask the user to enter a color (as a string; valid colors are 'red', 'yellow', 'blue'). Keep asking until a valid color is entered.
Draw a process flow diagram : Please draw a process flow diagram. What are (1) the bottleneck activity and (2) the maximum number of people that can be vaccinated per hour?
Explain quantitative and qualitative communication : Identify and briefly describe the main components of communication system processes. Explain quantitative and qualitative communication.
Explain how the time slice duration affect each other : Explain how the time slice duration and context switching time affect each other, in a round-robin scheduling algorithm.
Hcm problem solution and defense model : Using the Problem Solution Template, develop a HCM Problem/Solution and defense model in which you propose a solution to help Riordan

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

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