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

  Linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM.

  Create an animation of a square

create an animation of a square according to the directions below. Create a square with a side length of 3 with the square centered at (5,5). Translate this square along a cosine wave on the interval [0, 6*pi].

  Deterministic dimensions and rebar area

Performance function for bending of a rectangular reinforced concrete beam under moments due to dead and live loads

  Matlab m-script that will generate a damped sinusoid

1.) Write a MATLAB m-script that will generate a damped sinusoid (frequency = 440 Hz) with a time constant of 0.25 sec. Set the time axis for 0 to 6 time constants.

  Receives one number as an input argument

Write a function per2 that receives one number as an input argument. The function has a persistent variable that sums the values passed to it. Here are the first two time the function is called

  Write a matlab script and calculate the normalized scores

Write a MATLAB script that, when given a vector of numbers, nums, creates a vector newNums containing every other element of the original vector, starting with the first element.

  Compute the economy sized svd

Compute the economy sized SVD of the reshaped A matrix.

  Write a function called matrix summary

Write a function called matrixsummary that takes in one argument, a matrix or a vector, and returns four output values - the sum, mean, max and min of all the values in the matrix or vector.

  Implement the finite difference method

Write a computer program to implement the finite difference method. The program can be in any computer language that is available within the school. Set up the code to find the potential for a parallel plate capacitor in the box shown below, all dime..

  Finite difference method

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

  Matlab function to perform gauss-jordan elimination

Write a matlab function to perform gauss-jordan elimination with pivoting. Modify the pivoting so that it is using the row with the highest absolute value rather than the first non-zero row.

  An image histogram for a color image

goal is to build an image histogram for a color image based on its 6-bit color code.

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