如何在OSX 10.6.8上以八度打开.m文件 [英] How to open .m files in octave on OSX 10.6.8

查看:85
本文介绍了如何在OSX 10.6.8上以八度打开.m文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个文件ex1.m,我以八度"打开",但是它什么也没做.代码的前几行是....

This file ex1.m, I "open with" octave, but it doesn't do anything. the first few lines of code are....

%% 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;

等等....文件更多,我不确定如何运行该文件...

etc.... There were more files, I'm not sure how to get this to run...

推荐答案

这似乎是www.coursera.org提供的Andrew Ng的在线机器学习课程的一部分,您可能会很幸运在课堂网站的论坛上问这些问题尝试自己按照教程进行操作后.

This looks like part of Andrew Ng's Online Machine Learning class offered from www.coursera.org You might have more luck asking these questions in the forums at the class website after attempting to follow the tutorials yourself.

您首先需要在目录中包含所有相关文件.然后实际完成任务.在完成代码部分之前,这些任务大多数都不做.

You need to have all of the relevant files in the directory first. Then actually complete the assignment. Most of those assignments do nothing until you complete the code section.

此文件包含可帮助您开始进行线性练习的代码.您需要在此练习中完成以下功能:

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

完成后,打开mac终端,并cd到ex1.m所在的目录.您可以通过启动octave并输入文件的名称而没有扩展名.m来运行该程序.键入ex1.另外,如果您不想在程序运行完后进入八度外壳,则可以从终端输入octave -q ex1.m.

After you are done, open a mac Terminal and cd to the directory where ex1.m is located. You can run the program by starting octave and entering the name of the file without the .m extension. Type ex1. Alternatively, you could type octave -q ex1.m from the terminal if you don't want to be in the octave shell after the program is done running.

这篇关于如何在OSX 10.6.8上以八度打开.m文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆