Ask MATLAB Expert

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)

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M91301263
  • Price:- $50

Guranteed 36 Hours Delivery, In Price:- $50

Have any Question?


Related Questions in MATLAB

Assignment - matlab programmingusing appropriate matlab

Assignment - MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

Assignment details -need to write a code for connecting

Assignment Details - Need to write a code for connecting segments (Lines) a special case of TSP. The problem is to connect lines in 2d/ 3d space with path obstructions. Can you help me write the code for this? Hope you m ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -data is given on which want to do computational

Assignment - Data is given on which want to do computational production planning using Metaheuristic MATLAB Programming: 1) Ant Colony Algorithm on both Partial and Total Flexible Problem. 2) Bee Algorithm on both Partia ...

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Assignment matlab programmingusing appropriate matlab

Assignment: MatLab Programming Using appropriate MatLab syntax, write the code required to analyse and display the data as per the problem description. The order of the MatLab Program should be as follows: Variables and ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As