• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/40

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

40 Cards in this Set

  • Front
  • Back

Base 2 Log ?

log2(x)

How to get value of e ?

exp(1)

Inverse Trig of sine ?

asind(x)

Degree version of sine ?

sind(x)

Natural logarithm? (ln) ?

log(x)

True or False?




Pi is a constant?

True

Base 10 Log?

log10(x)

Field Specifications:




%c

Will print out ONE character

Field Specifications:




%s

Will print out an entire string

Programming Essentials:




A program must have what?

Memory / Operations / Branching

What is echo, and how to suppress it?

Instant display of calculation as a command is executed.




Suppress with semicolon ;

What is Left Division?


What is B\A

B\A divideseach element of A by the corresponding elementof B.

Negative sign counts as multiplication by ?

(-1)

-3.1415


How many significant digits?


How many character spaces used?

Significant digits = 5




Total number of character spaces used = 7

0.000002718


How many significant digits?


How many character spaces used?



Significant digits = 4




Total number of character spaces used = 11

The keyword "if" structure must end with ?

"end"

Does the end line require a semicolon?

No, the end line does not require a semicolon.

True or False


The if must have a logical expression (condition) after it?

True, and it does NOT end with a semicolon

What is the largest integer that can be displayed without extra formatting?

999999999 (nine digits)

Logical variables:




Zero = ?

False



Logical variables:


Any non-zero number = ?

True



Never compound comparisons:




4>3>2 is (true / false) ?





False

format long




allows how many significant digits?

generally 15 or 16 , usually up to 15 after the decimal point.

True or False?




The last digit is a rounded digit?

True, there is a HIDDEN digit and the last displayed digit is rounded.

A variable is a place to store data, what are the two types of data we have seen?

numerical and string data.

True or False ?




There should be a block of code with the "if", with each "elseif", and the "else" ?

True

What would you type in the command window to execute the file Snowman.m?

2 possible answers




Snowman


or


run Snowman.m

How many things get printed out if we execute... (assume proper indentation)


S = 0;


for k = 1:10


S=S+k;


disp(S);


end

10 numbers.


It completes the for loop a total of 10 times. Displaying S 10 times.

What symbol allows us to write more than one statement on a line?

the semicolon ;




example


x = 5; y = 2; z = 1.0;

What does the clc command do?

Clears the command line window.



What does the clear command do?

Erases the Workspace variables.

%10.3f


What does the 10 mean?


What does the 3 mean?


What does the f stand for?

10 total spaces should be used.


3 digits after the decimal should be used.


float (like floating point number)

Field specifications:




%d

Will print out an integer

What function would you use to read something in from the keyboard?

The input() function




example


userAnswer = input("Please enter your age: );





What do you type in a program to make it stop executing at a specific point?

return;




example (assume proper indentation)


if doughnut > 2


disp("Whew! I'm full. I'm taking a nap..\n"); return;


end

For arithmetic and functional operations, the order of operations is:

( )




^




*,/ , \




+,-

True or False?




-12 && 5.3

Statement is true, or a logical 1




0 equals false


All other numbers are a logical 1


So true && true

what does disp() display?

Can output a single object OR a single string


(not both)

What is the \n called?

Carriage control


It puts the cursor on the next line of where the string is being outputted.


example disp("wow.\nThis is output on the next line\n\nwowie")

We want to stop a loop when a == 2 && b ~=2


How do we write the condition inside the for-loop?

if ~(a==2 && b~=2); return; end




The tilde ~ is negating our original condition.