Professional Documents
Culture Documents
x = 4:2:10
x = (4:2:10)'
x = x'
x = rand (1)
x= rand (5,2)
x = zeros (5,2)
save datafile.mat data
save ilovezeros x
%save [title] [file] - if no file, the entire workspace will be saved
load ilovezeros
v = data(6,2)
v = x(2,1)
v = x(end, 2)
density = data (2,:)
volume =data (1:3, :)
vm = max(va)
vr = round(va)
[3 4].*[1 2]
mass = density .* va
doc randi
close all
&|
v = v1(v1<4) --> v contains all elements of v1 that are less than 4
s = sample(v1<4) --> s contains all elements in 'sample' corresponding to where v1
is less than 4
v1(v1>5) = 10 --> all values in v1 greater than 5 are replaced by '10'
x=rand
if x>0.5
y=3;
else
y-4;
end