Exam 1 Cheat Sheet
Volatile memory: temporary, fast (RAM, DRAM) Nonvolatile: permanent, slow (ROM, CD)
- OS: allocates computer resources, allows comm between user and comp
-Language types: highlevel(humans not computers), lowlevel(hard for both),
Machine
% Lecture 6
clc, clear
% Data
x = 1:0.1:4;
y = 0.1*exp(x);
z = sin(x)
w = 1:5;
% Plotting
plot(x,y) % y vs. x
plot(x,y,x,z) % y & z vs. x
plotyy(x,y,x,z)
comet(x,y) % animation command
title('My Title')
xlabel('x label')
ylabel('y label')
grid on
pause %
Exam 2 Cheat Sheet
Volatile memory: temporary, fast (RAM, DRAM) Nonvolatile: permanent, slow (ROM, CD)
- OS: allocates computer resources, allows comm between user and comp
-Language types: highlevel(humans not computers), lowlevel(hard for both),
Machine
% Lecture 10
clc, clear all, close all
%
n = 2
x = -5:0.01:5;
y = x.^2; % points y = x^2 for dom(x) in [-5,5]
plot(x,y)
%
[a,b] = ginput(n) % uses n points
%
[c,d] = ginput % accepts points until user hits enter/return
% entering data
% double click on da
Sottile
CMPSC 200 Programming for Engineers with MATLAB
Lecture 22 Recitation Problems Partial Solutions
1) Part a)
syms x y a
one_a = 2*(x + 2*y) + 0.5*y^2 + 3*(a+3*y)
pretty(one_a)
Part b)
syms a y x
one_b = a*y/(2*x^2)
pretty(one_b)
2) Part b)
syms x
t
Sottile
CMPSC 200 Programming for Engineers with MATLAB
Lecture 22 Recitation Problems
1) Create symbolic expressions for the following, then display with the pretty command:
%
a. 2 + 2 + & + 3( + 3)
b.
+,
&
&- .
2) Create symbolic equations for the f
Sottile
CMPSC 200 Programming for Engineers with MATLAB
Lecture 03 Outline
Related Reading: Chapter 2, 2.3.2; Chapter 3, 3.1 through 3.4
Array Operations
1) MATLAB stores arrays of data as matrices
1 2
2) A few equivalent statements to write =
3 4
a. A