
clear				% Clear previous definitions
figure(1)           % Assign figure number
clf                 % Clear previous figures
hold off            % Start with fresh graph

mytitle = 'Weight of Lake Trout'; 	% Title
xlab = 'Age (Years)'; 		        % X-label
ylab = 'Weight (g)'; 	         	% Y-label

load('fishdat');         % Provide vectors of Lake Trout data

tt = linspace(0.1,20,500);	% t domain of function
Wt = 6295.442*(1-exp(-0.14553*tt)).^3;    % Function for W(t)
W2t = 5677.67*(1-exp(-0.16960*tt)).^3;    % Function for W(t)

plot(tt,Wt,'b-','LineWidth',1.5);  % Plot model
hold on                            % Plots Multiple graphs
plot(tt,W2t,'r-','LineWidth',1.5);  % Plot model
plot(tdfish,wdfish,'bo','LineWidth',1.5);  % Plot data with circles
grid                                % Adds Gridlines
legend({'Cubic von Bertalanffy','Nonlinear Fit','Data'},'location','Northwest', 'FontSize',10,'FontName','Times New Roman');  % Create legend
xlim([0 20]);  % Defines limits of graph
ylim([0 6000]);
fontlabs = 'Times New Roman';   % Font type used in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % x-Label size and font
ylabel(ylab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % y-Label size and font
title(mytitle,'FontSize',16,'FontName','Times New Roman','interpreter','latex'); 
        % Title size/font
set(gca,'FontSize',12);         % Axis tick font size

print -depsc wtfish.eps		% Create figure as EPS file
%print -djpeg wtfish.jpg		% Create figure as JPEG file

