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

  T prints out, on a clear screen, a table of temperatures

Create a MATLAB program (utilizing a temp-conversion function) that prints out, on a clear screen, a table of temperatures.

  Perform linear regression on penicillin clearance

Perform linear regression on penicillin clearance using the normal equations - plot the concentration data and re-plot the log of the concentration data to show that it appears linear.

  Write a matlab code using the switch statement

Solve the system of equations using the MATLAB functions or operators - Write a MATLAB script to plot the piece-wise function

  Write an application to read in a noisy image

Write an application to read in a noisy image, filter the image and output the image to a new file for comparison with the original normal image.

  Consider the predator-prey models

Consider the predator-prey models developed early part of the 20 th  century in which the number of predators and preys may be predicted using the pair of ODEs

  Explain why viscosity is an important property in fluid

2. (a) (i) Define dynamic viscosity and give the mathematical formula for Newton's law of viscosity.(ii) How does kinematic viscosity differ from dynamic viscosity?(b) Explain why viscosity is an important property in Fluid Mechanics.

  Prepare model on reaction-diffusion equation

Prepare model on reaction-diffusion equation by using Matlab program. Read notes and attachments then program it. Also, write brief explanation what will do

  Matlab i uploaded the requirments

i uploaded the requirments

  Write and test a function that computes the time

Write a script le that accepts user input for d, L, and r and computes and displays C. Test the le with the values L = 1 m, r = 0.001 m, and d = 0.004 m.

  Design and computations - digital signal processing

Compute the time dependent Fourier transform of the complex digital signal. Plot it as a 2- dimensional function of true analog frequency (Hz) on the y-axis and time (sec) on the x-axis between 0 to 10 sec.

  Compute and plot the magnitude spectra of the waking

BE4800 Biomedical Digital Signal Processing Final Project. Compute and plot the magnitude spectra of the waking and LOC ERP signals

  Type of study and phenomenon of interest

Summarize the type of study and phenomenon of interest, discuss whether the sample and population used were appropriate and Summarize results, limitations of results, conclusions, and applications.

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