Graphics Programs Reference
In-Depth Information
letters = 'abcdefghijklmnopqrstuvwxyz';
caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
for n = 1:26
count(n) = sum(str == letters(n)) + sum(str == caps(n));
end
bar(count)
ylabel 'Number of occurrences'
title(['Letter frequencies in ' file])
set(gca, 'XLim', [0 27], 'XTick', 1:26, 'XTickLabel', ...
letters')
Here is the result of running this M-file on itself:
letcount('letcount.m')
Letter frequencies in letcount.m
30
25
20
15
10
5
0
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Problem 8
We let w, x , y , and z , denote the number of residences canvassed in the four
cities Gotham, Metropolis, Oz, and River City, respectively. Then the linear
inequalities specified by the given data are as follows:
Nonnegative data: w 0 , x 0 , y 0 , z 0;
Pamphlets: w + x + y + z 50 , 000;
Travel cost: 0 . 5 w + 0 . 5 x + y + 2 z 40 , 000;
Time available: 2 w + 3 x + y + 4 z 18 , 000;
Preferences: w x , x + y z ;
 
Search WWH ::




Custom Search