changeset 5:db337ab61192

Minor fixes to ex1.m
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 26 Oct 2011 07:51:52 -0700
parents e9414949c7b7
children 276e3e52bdce
files ex1.m
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ex1.m
+++ b/ex1.m
@@ -30,10 +30,10 @@
 % Complete warmUpExercise.m 
 fprintf('Running warmUpExercise ... \n');
 fprintf('5x5 Identity Matrix: \n');
-warmUpExercise()
+warmUpExercise();
 
-fprintf('Program paused. Press enter to continue.\n');
-pause;
+%fprintf('Program paused. Press enter to continue.\n');
+%pause;
 
 
 %% ======================= Part 2: Plotting =======================
@@ -46,8 +46,8 @@
 % Note: You have to complete the code in plotData.m
 plotData(X, y);
 
-fprintf('Program paused. Press enter to continue.\n');
-pause;
+%fprintf('Program paused. Press enter to continue.\n');
+%pause;
 
 %% =================== Part 3: Gradient descent ===================
 fprintf('Running Gradient Descent ...\n')
@@ -72,7 +72,7 @@
 % Plot the linear fit
 hold on; % keep previous plot visible
 plot(X(:,2), X*theta, '-')
-legend('Training data', 'Linear regression')
+legend('Training data', 'Linear regression', 'location', 'southeast')
 hold off % don't overlay any more plots on this figure
 
 % Predict values for population sizes of 35,000 and 70,000
@@ -83,8 +83,8 @@
 fprintf('For population = 70,000, we predict a profit of %f\n',...
     predict2*10000);
 
-fprintf('Program paused. Press enter to continue.\n');
-pause;
+%fprintf('Program paused. Press enter to continue.\n');
+%pause;
 
 %% ============= Part 4: Visualizing J(theta_0, theta_1) =============
 fprintf('Visualizing J(theta_0, theta_1) ...\n')