osx leopard -如何在osx 10.6.8上打开.m文件



此文件ex1。m,我"打开"八度,但它没有做任何事情。前几行代码是....

%% Machine Learning Online Class - Exercise 1: Linear Regression
%  Instructions
%  ------------
% 
%  This file contains code that helps you get started on the
%  linear exercise. You will need to complete the following functions 
%  in this exericse:
%
%     warmUpExercise.m
%     plotData.m
%     gradientDescent.m
%     computeCost.m
%     gradientDescentMulti.m
%     computeCostMulti.m
%     featureNormalize.m
%     normalEqn.m
%
%  For this exercise, you will not need to change any code in this file,
%  or any other files other than those mentioned above.
%
% x refers to the population size in 10,000s
% y refers to the profit in $10,000s
%
%% Initialization
clear ; close all; clc
%% ==================== Part 1: Basic Function ====================
% Complete warmUpExercise.m 
fprintf('Running warmUpExercise ... n');
fprintf('5x5 Identity Matrix: n');
warmUpExercise()
fprintf('Program paused. Press enter to continue.n');
pause;

等等……还有更多的文件,我不确定如何让这个运行…

这看起来像是Andrew Ng在www.coursera.org提供的在线机器学习课程的一部分。在尝试自己遵循教程之后,您可能会在课程网站的论坛上询问这些问题。

您首先需要在目录中拥有所有相关文件。然后真正完成作业。在你完成代码部分之前,大多数的任务什么也不做。

此文件包含帮助您开始线性练习的代码。在本练习中,您需要完成以下函数:

 warmUpExercise.m
 plotData.m
 gradientDescent.m
 computeCost.m
 gradientDescentMulti.m
 computeCostMulti.m
 featureNormalize.m
 normalEqn.m

操作完成后,打开mac终端,cd到"ex1.m"所在目录。您可以通过启动octave并输入文件的名称来运行程序,而不带.m扩展名。输入ex1。或者,如果您不想在程序运行完成后进入octave shell,您也可以在终端输入octave -q ex1.m

最新更新