Documente Academic
Documente Profesional
Documente Cultură
histogram(data,'BinMethod','integ
ers')
TASK
Create a histogram of the years, found in
the Yearvariable of tunnels, that the
tunnels were completed. Give each year in
the range its own bin.
TASK tunnels.Continent =
There are five cell arrays mergecats(tunnels.Region,europe,'Europe');
named europe, na, sa, asia, tunnels.Continent =
and africa defined in the script. They mergecats(tunnels.Continent,na,'North America');
contain a list of countries in the dataset. tunnels.Continent =
Use these cell arrays to create a new mergecats(tunnels.Continent,sa,'South America');
categorical variable tunnels.Continent =
named Continent in tunnels. This
mergecats(tunnels.Continent,asia,'Asia');
variable should have the following
tunnels.Continent =
categories:
mergecats(tunnels.Continent,africa,'Africa');
Europe histogram(tunnels.Continent(tunnels.Type == 'Railway'))
North America title('Longest Railway Tunnels')
South America
Asia
Africa
TASK c = polyfit(lbPlayers.RBI,lbPlayers.RC,1);
Add a straight fitted line to the plot. RBIfit = [min(lbPlayers.RBI) max(lbPlayers.RBI)];
RCfit = polyval(c,RBIfit);
hold on
plot(RBIfit,RCfit)
hold off
TASK th = linspace(0,2*pi)';
Add the orbits for the first six planets xc = cos(th);
in planets to the plot using black dotted yc = sin(th);
lines. hold on
for k = 1:6
For each planet, use the value in Radius to
create the x-y data needed to plot a circular plot(planets.Radius(k)*xc,planets.Radius(k)*yc,'k:')
orbit.
end
hold off
TASK r = round(sqrt(cassini.x.^2 + cassini.y.^2 +
Add a variable named Times to cassini.z.^2),2);
the planets table which contains the t = zeros(length(planets.Radius),1);
number of times the spacecraft intersects for k = 1:length(planets.Radius)
the orbit of each of the planets. t(k) = nnz(r == planets.Radius(k));
end
planets.Times = t