Computational Methods lecture 1

?
  • Created by: cbd19
  • Created on: 10-02-20 14:28
What must you do at the start of a program?
To remove memory type clear, and to clear command window then type clc. Type close all to get rid of any figures
1 of 12
To create variable a=4.5 what do we type?
a=4.5
2 of 12
How would you get the square root of a variable in matlab?
sqrt(x)
3 of 12
How would you get log to base e of x?
log(x)
4 of 12
How would you get log to base 10 of x?
log10(x)
5 of 12
How would you get e^x?
exp(x)
6 of 12
How would you get sin, cos, and tan of x?
sin(x), cos(x), tan(x)
7 of 12
What would we write to prompt the user to input a density?
density=input(’ Enter the fluid density in kg/m^3’)
8 of 12
How would you get 'the answer is' displayed?
disp('the answer is')
9 of 12
How would you display an inputted variable such as density?
disp(density)
10 of 12
What do the percent symbols denote?
% symbol denotes comments and %% symbol denotes starts and ends of sections
11 of 12
What is 0.01 written like in matlab?
1e-2
12 of 12

Other cards in this set

Card 2

Front

To create variable a=4.5 what do we type?

Back

a=4.5

Card 3

Front

How would you get the square root of a variable in matlab?

Back

Preview of the front of card 3

Card 4

Front

How would you get log to base e of x?

Back

Preview of the front of card 4

Card 5

Front

How would you get log to base 10 of x?

Back

Preview of the front of card 5
View more cards

Comments

No comments have yet been made

Similar Civil Engineering resources:

See all Civil Engineering resources »See all introductory resources »