Find command to list the eligible ages

Assignment Help MATLAB Programming
Reference no: EM13742933 , Length: 1

QUESTION 1

Given the following age= [15,17,25,55,76]

Use the find command to list the eligible ages (not the index number) for a standard driver's license. Eligible applicants are at least 18 years old but less than 70 years old.

age(find(age<70 & age>=18))

find(age>=18 & age<70)

find(age<70 & age>=18)

age(find(age>=18 && age<70))

age(find(age>=18 & age<70))

age(find(age>=18 I age<70))

QUESTION 2

What data type (class) is accepted by the fprintf function?

logical

single

char

none of these

double

QUESTION 3

Finish the code:

volume = input('Enter amount of gas: \n')

pick= menu('Measure the gasoline in liters or gallons?','gallons','liters')

switch

factor = 1; unit= 'gallons'

factor = 0.264172;

unit = liters'

%close the switch structure

rate=2.16; %dollars per unit

fprintf('That will be $ %5.2f for %5.1f %s \n', volume*factor*rate, volume, unit)

QUESTION 4

Use [x,y]=gtext(1) to pick many points off a graph with crosshairs and output the coordinates.

True False

QUESTION 5

Use fprintf to output to the command window AND to a text file called approx.txt.

A data dictionary and descriptive comments that show that you understand the program.

QUESTION 6

Create a midpoint break loop. Here's how to organize it.

%Use an infinite while command to begin

%Next, ask the user for input

%Test if the answer is not a positive number

%If their answer is not a positive number, inform them that it must be a positive number

%Otherwise, total up the cost

%Print out the total to a text file

%Break out of the infinite loop

%End the program

1. A. else
2. B. if num_candy_bars>0
3. C. if num_candy_bars<0
4. D. break
S. E. fid=fopen('bill.txt','w'); fprintf(fid,'The total cost is %S.2f dollars \n',total); fclose(fid);
6. F. end %while loop
7. G. disp('Must be a positive number, try again')
8. H. while n<3
9. I. while(1)
10 J. num_candy_bars=input('Enter the number of candy bars');

K. end %if

L. total-num_candy_bars*0.75:

QUESTION 7

What is the result of the following logical operation and what class is the output? Given x=1:5; y=[-2, 0, 2, 4, 6]; z=8:-1:4;

(z>x I z>y) & x>y

ans=

1 1 1 0 0

ans would belong to the double class ans =
1
1
1
0
0

ans would belong to the double class ans =

1 1 1 0 0

ans would belong to the logical class

QUESTION 8

Turn in yourlastname4.m

Since we are studying repetitive structures this week, make sure you use a loop for this exercise! Please see and adhrere to the attached the directions for this exercise: Homework4 Halev.odf

QUESTION 9

Consider this bit of code.

1 C=[30,55,10];

2 if C<=55

3 disp('G is a small value equal to:')

4 disp(G);

5 end %if

Do lines 3 and 4 execute?

True

False

QUESTION 10

Let's say you have defined a numeric variable, num=10.

What is the command to change a numeric type into a character (or string) type? double(num)

- num2str(num)
- sprintf('Yos ', num)
- char(num)
- fprintf('%s ', num)
- str2num(num)

Reference no: EM13742933

Questions Cloud

Affect prices for concert tickets-rate for radio programming : Clear Channel, an owner of radio stations with the Top 40 format, recently bought rock concert promoter Live Nation. How would this affect prices for concert tickets or rates for radio programming?
What new perspective did you gain : What new perspective did you gain from the course Resources and/or from your interactions with your peers and your Instructor? How might this new perspective influence an attitude or behavior
Currently only one producer-the incumbent monopolist : You are considering entry into a market in which there is currently only one producer, the incumbent monopolist. If you enter, the incumbent can take one of two strategies, price low or price high. If they price high, then you expect a $60k profit pe..
Create a work breakdown structure : Remember that the WBS starts with your major deliverables (that you stated in your scope management plan) at the highest level. The lower levels have the work package required to complete those deliverables.
Find command to list the eligible ages : What is the command to change a numeric type into a character (or string) type? double(num) - find command to list the eligible ages
Substitute product can reduce inter-product cannibalization : A firm that acquires a substitute product can reduce inter-product cannibalization by
Write a paper on batallion commanders and division commander : Write a paper on batallion commanders, individual soldiers in the field, General William Westmoreland, President Lyndon Johnson and division commander.
In converting the residual to a student zed : In converting the residual to a student zed (standardized) residual for a given observation, the residual for the observation is divided by the residual's __________.
What is the appropriate sampling method : How would you describe the population that will be sampled. What is the appropriate sampling method

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