% rec08sol.m  recitation8 solutions
% 400:127  Fall 2014  S. J. Orfanidis
% 
clear all
% Exercise 1(a)
% 
N = 20;
S = 0;
for k=1:N
S = S + k^3;
end
fprintf('S = %4.0f, forloop\n', S);
% 
S = 0;
k = 1;
while k<=N, % continue while k<=N, break when
Contents
Practice Exam
2
3
4
5
problem 6
problem 7 part 1
Prob 7 part 2
Practice Exam
x=linspace(0,10,100001);
y=@(x) x./(x.^2+10);
[max_val,imax]=max(y(x);
max_point=[x(imax),max_val]
[max_val2]=fminbnd(@(x) y(x),0,10)
max_point2=[max_val2,y(max_val2)]
Homework Problems Week 3
440:127 Spring 2012 S. J. Orfanidis
This homework set is due online at Sakai no later than 5:00 AM on Monday, February 13, 2012. Please
submit the HTML le together with any supporting PNG les generated by MATLABs publish command f
Recitation Problems Week 4
440:127 Spring 2014 S. J. Orfanidis
Please do the following problems from your textbook during your recitation session, including any additional problems given to you by your TA. Upload the complete solutions within 48hrs of you
Recitation Problems Week 1
440:127 Spring 2014 S. J. Orfanidis
Please do the following problems during your recitation session, including any additional problems given
to you by your TA. Within 48 hours of your recitation session, you must upload the comp
Recitation Problems Week 7
440:127 Fall 2015 N. B. Mandayam and S. Khan
Please read the week7 powerpoint lecture notes and Ch.8 of the text prior to going to your recitations sessions.
Please do the following problems during your recitation session, incl
Recitation Problems Week 8
440:127 Spring 2014 S. J. Orfanidis
Please read Ch.9 of the text and the week8 lecture notes and class notes prior to going to your recitations
sessions. Please do the following problems, including any additional problems given
Recitation Problems Week 7
440:127 Fall 2014 S. J. Orfanidis
Please read the week7 powerpoint lecture notes and Ch.8 of the text prior to going to your recitations
sessions. Please do the following problems during your recitation session, including any a
Recitation Problems Week 2
440:127 Fall 2014 S. J. Orfanidis
The objectives of this weeks recitation are to get you familiar with some matrix operations, the use of the
builtin functions min, max, sum, cumsum, sort, sortrows, dening your own anonymous fu
Contents
Problem 1
Problem 2
Problem 3
% Recitation solutions  weeks 5&6
%clear all
Problem 1
f = @(x,a,b,c) exp(a*x).*cos(b*x) + cos(c*x);
a = 0.5; b = 2; c = 3;
g = @(x) f(x,a,b,c);
h = @(x) f(x,a,b,c);
figure; fplot(g,[0,4], 'b'); grid on;
hol
From:
Date:
To:
CC:
null <Saved by Mozilla 5.0>, null <>
Thu, 11 Sep 2014 04 03 50 0500
Subject: rec0506sol
Contents
Problem 1
Problem 2
Problem 3
% Recitation solutions  weeks 5&6
%clear
all
Problem 1

f = @(x,a,b,c) exp(a*x).*cos(b*x) + cos(c*x);
a
Recitation Problems Weeks 5 & 6
440:127 Fall 2014 S. J. Orfanidis
Please do the following problems during your recitation session, including any additional problems given
to you by your TA. Upload the complete solutions within 48hrs of your session.
1. Co
% Recitation solutions  weeks 5&6
%
clear all
% Problem 1
% 
f = @(x,a,b,c) exp(a*x).*cos(b*x) + cos(c*x);
a = 0.5; b = 2; c = 3;
g = @(x) f(x,a,b,c);
h = @(x) f(x,a,b,c);
figure; fplot(g,[0,4], 'b'); grid on;
hold on;
[x1,f1] = fminbnd(h, 2,3); f1
Contents
Problem 1
Practice Exercises 3.5
Practice Exercises 3.6
Practice Exercises 3.7
EndofChapter Problem 3.15
Problem 2
% rec02sol.m  solutions to week2 recitations
% Fall 2014  S.J.Orfanidis
% clear all
% 
Problem 1
Practice Exercises 3.5
x =
From:
Date:
To:
CC:
null <Saved by Mozilla 5.0>, null <>
Sun, 31 Aug 2014 12 54 27 0500
Subject: rec02sol
Contents
Problem 1
Practice Exercises 3.5
Practice Exercises 3.6
Practice Exercises 3.7
EndofChapter Problem 3.15
Problem 2
% rec02sol.m  solutio
Recitation Problems Week 1
440:127 Fall 2014 S. J. Orfanidis
Please do the following problems during your recitation session, including any additional problems given
to you by your TA. Within 48hrs of your recitation session, you must upload the complete
Lecture 2
Conditional Statements:
If/Then/Else, Switch/Case
Page 2
Comments & NaN
Comments  Comments are often used in MATLAB to add text within scripts
that will NOT be processed or displayed by MATLAB upon running the script,
allowing the user to leav
Lecture 5
2D & 3D Plotting, Modifying Plots
Page 2
Basic 2D Line Plotting
Basic plotting is rather simple in MATLAB. While we will go into much more
detail with plotting methods, both in two and three dimensions, we will
briefly talk about plotting ju
Lecture 3
Numerical Vector and Matrix Manipulations
Page 2
Numerical Arrays
MATLAB also has superior vector & matrix manipulation abilities when
compared to other programming languages, as hinted by its full name, MATrix
LABoratory.
Numerical Array  A
Homework Problems Week 1
440:127 Fall 2014 S. J. Orfanidis
1. Endofchapter Problem 2.14. Use format short e to print your results.
2. Problem 2.15. Use format short e to print your results.
3. Problem 2.18. Use format short e to print your results. Reve
Rutgers University
School of Engineering
Fall 2014
14:440:127  Introduction to Computers for Engineers
Sophocles J. Orfanidis
ECE Department
orfanidi@ece.rutgers.edu
week 2
Weekly Topics
Week 1  Basics variables, arrays, matrices, plotting (ch. 2 & 3)
W
It shows his velocity at time points during his jump. We can
transcribe the video into two vectors, time and velocity.
>From these we can calculate his average acceleration between each data point.
We know that this will be somewhere in the range of 9.8
Format Codes for fprintf and fscanf
Format as a string.
0 Format as an integer.
0 Format as a floating point value.
%e Format as a floating point value in scientific notation.
%g Format in the most compact form: 0 or %e.
\n Insert a new line in the outpu
Kishan Patel
Contents
Recitation 11
Problem 1
Part F
Problem 2
Problem 3
Recitation 11
Problem 1
Part A
figure
T_ci=[20,0,20,40,70,100,200,300,400,500]'
V_i=[1.63,1.71,1.82,1.87,2.03,2.17,2.53,2.98,3.32,3.64]'
Ti=T_ci+273.15
z=Ti.^(3/2)./V_i;
p = polyfit