function [root_f,iter_f] = falseposition(f,xl,xu,precision)
% INPUTS:
% - f: function handle of the equation to be solved
% - xl: lower limit of the initial guess
% - xu: upper limit of the initial guess
% - precision: stopping criteria determined by the
%comparing the efficiencies of the different methods
%Lab 6 Task 5(b)
clear all;
close all;
clc;
%parameters for root finding
xl=120;
xu=165;
xi=120;
xi_1=110;
pert=0.01;
precision=0.0001;
%input the length of each link
a=1;
b=2;
c=4;
d=5;
t2=30;
% 0=(d/a
function y= euler(dydt,xrange,y0,h);
% [t,y] = euler(dydt,tspan,y0,h):
% uses Euler's method to solve an ODE
% input:
% dydt = function handle of the ODE, f(t,y)
% tspan = [<initial value>, <final value>] of independent variable
% y0 = initial value of d
%comparing the efficiencies of the different methods
%Lab 6 Task 5(b)
clear all;
close all;
clc;
%parameters for root finding
xl=120;
xu=165;
xi=120;
xi_1=110;
pert=0.01;
precision=0.0001;
%input the length of each link
a=1;
b=2;
c=4;
d=5;
t2=30;
% 0=(d/a
ENG1060 Computing for Engineers
Faculty of Engineering
Semester 1 - 2014
ENG1060 Computing for Engineers
Laboratory No. 8
This laboratory comprises 2% of your final grade. During your lab session,
you will be assessed on your programming style as well as
ENG1060 Computing for Engineers
Faculty of Engineering
Semester 1 - 2014
ENG1060 Computing for Engineers
Laboratory No. 9
This laboratory comprises 2% of your final grade. During your lab session,
you will be assessed on your programming style as well as
MONASH
ENGINEERING
ENG1060
MATRIX CALCULATIONS
Presented by Tony Vo
Slides by Tony Vo
ENG1060
SCALAR VS. MATRIX CALCULATIONS
Basic scalar operators include: + - * / ^
E.g. 5*6 = 30
However, these are not necessary the same for matrix calculations
E.g. M
MONASH
ENGINEERING
ENG1060
MATRICES: CREATING 2D MATRICES
Presented by Tony Vo
Slides by Tony Vo
ENG1060
CREATING 2D MATRICES
A two-dimensional matrix contains multiple rows and columns
Use square brackets [ ] to create a two-dimensional matrix
MATLAB re
MONASH
ENGINEERING
ENG1060
WELCOME TO ENG1060:
COMPUTING FOR ENGINEERS
Presented by Tony Vo
Slides by Tony Vo
ENG1060
MATLAB
Use MATLAB to
Think as an engineer
Develop problem solving techniques
Understand commonly used numerical methods
Create and visual
MONASH
ENGINEERING
ENG1060
MATRICES: CREATING 1D MATRICES
Presented by Tony Vo
Slides by Tony Vo
ENG1060
WHAT IS A MATRIX?
Matrix structure: rows first, then columns (rows-by-columns)
=1
(scalar)
= 1 21 36 44 25
18
23
C= 84
65
19
(row vector, which is al
MONASH
ENGINEERING
ENG1060
PART A: MARS
Presented by Tony Vo
Slides by Tony Vo
ENG1060
MARS
A.
B.
C.
D.
Determine the output of the following command:
7 / 7 + 5 * 2 ^ 3 (9 0 / 4)
32
992
0
Error
2
ENG1060
MARS
Which command calculates the natural logarithm
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #3: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #2: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #5: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #4: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #1: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
ENG1060: Computing for Engineers
Faculty of Engineering
ENG1060: Computing for Engineers
2016 - Semester 2
Laboratory #6: Questions
This laboratory comprises 2% of your final grade. The questions are designed to test your
recollection of the lecture mater
MONASH
ENGINEERING
ENG1060
WELCOME TO ENG1060
Presented by Tony Vo
Slides by Tony Vo
ENG1060
CLAYTON UNIT STAFF
FEED CODE: JGHUQT
Prof. Murray Rudman
Lecturer and unit coordinator
murray.rudman@monash.edu
Dept. of Mech. & Aero. Eng.
Dr Tony Vo
Lecturer an
MONASH
ENGINEERING
ENG1060
MATLAB INTERFACE AND M-FILES
Presented by Tony Vo
Slides by Tony Vo
ENG1060
MATLAB INTERFACE
Current folder
Command window
Workspace
Help
2
ENG1060
COMMAND WINDOW
Treat the command window as a temporary calculator
ALWAYS assign
MONASH
ENGINEERING
ENG1060
MATLAB BASICS
Presented by Tony Vo
Slides by Tony Vo
ENG1060
COMPUTER LABORATORIES
FEED CODE: JGHUQT
Labs starts next week
Labs are run in building 60 (23 College Walk)
Programming requires a lot of practice
Labs allow you to
MONASH
ENGINEERING
ENG1060
PLOTTING DATA
Presented by Tony Vo
Slides by Tony Vo
ENG1060
PLOTS
Visualising the data allows you to interpret more information and more
quickly
Easier to characterise trends
I.e. Is it increasing or decreasing with increasing
MONASH
ENGINEERING
ENG1060
VARIABLES
Presented by Tony Vo
Slides by Tony Vo
ENG1060
WHAT IS A VARIABLE?
A variable is a MATLAB "object" whose value can change
You have used variables in algebra
E.g. The Lecturer's age is twice the age of the Student
L=2S
clear all; close all; clc;
help linspace
linspace(1,10)
linspace(1,10,5)
help sind
sind(56)
sind(5*pi)
help mod
mod(8,5)
mod(6,3)
help log
log(4)
log(1.23)
help ceil
ceil(7.1)
ceil(4.8)