Computational Methods lecture 1 0.0 / 5 ? Civil EngineeringintroductoryUniversityNone Created by: cbd19Created 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
Comments
No comments have yet been made