{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 BASIC COMMANDS\par
\par
a = 1\par
b = 2\par
c = a+b\par
d = cos(a)
\par
t =[1 2 3 4 5]\par
t=0:0.01:1;\par
y = sin(2*pi*t)\par
plot(t,y)
\par
x = 3 + 4i\par
a = [1 2 3; 4 5 6; 7 8 9]\par
data=rand(5,5)\par
size(data)\par
eig(data)\par
b=a'\par
c=a*b\par
c=a.b\par
inv(a)*a\par
a(2,3)\par
data(1:3,2:end)\par
data(1:2,:) = 0\par
\par
\par
WRITING A PROGRAM\par
Command window is for individual commands\par
Write as a text file .m\par
Click on create a new program, opens Matlab editor\par
Save, give a name\par
Can run program (called script) by clicking green run button).\par
Runs all commands, could right click program and hit run\par
Can edit and change.\par
Can type script name in command window to run.\par
Must be in current folder or search path.\par
Current folder displayed up top.\par
Can open by double clicking or using edit\par
use
x = (1:1000)';
for k=1:5\par
y(:,k)=k*log(x);\par
end\par
plot(x,y)\par
\line\par
want to create function files\par
start with function keyword\par
have a function name that should match name of file\line can pass in values\par
function simple(maxLoop)\par
x=(1:1000)'
for k=1:maxLoop\par
y(:,k)=k*log(x);\par
end\par
plot(x,y)\par
\par
\par
Generate values from the uniform distribution on the interval [a, b].\par
r = a + (b-a).*rand(100,1);\par
\par
Generate integer values from the uniform distribution on the set 1:n.\par
r = randi(100,1);\par
\par
a = randi([0,1],5:5)\par
b = [1 2 3 4 5]'\par
c = a*b\par
d = eig(a)\par
d(2)\par
real(d(2))\par
a^2 * a^2
a^2 .* a^2
\par
http://blogs.mathworks.com/steve/2007/08/13/image-deblurring-introduction/\par
\par
pic = imread('WMIAS.jpg');\par
\par
\par
\par
License number: 1306148 Activation type: Trial - Designated Computer Activated by: steven.j.miller@williams.edu This information will be sent to MathWorks.\par
\par
\par
h = fspecial('disk',4);\par
cam = im2double(imread('WMIAS.jpg'));\par
hf = fft2(h,size(cam,1),size(cam,2));\par
cam_blur = real(ifft2(hf.*fft2(cam)));\par
imshow(cam_blur)\par
}
Error: File: C:\Documents and Settings\Steven Miller\My Documents\MATLAB\General.m Line: 1 Column: 2
Unexpected MATLAB operator.