用八度音阶显示图形窗口

时间:2016-04-08 16:07:01

标签: matlab plot octave

我是八度的新手。

我想显示我用八度音绘制的数字,但没有显示数字窗口。

这是我要绘制的内容,plot.m

x = load('ex2x.dat');
y = load('ex2y.dat');
figure % open a new figure window
plot(x, y, 'o');
ylabel('Height in meters')
xlabel('Age in years')

我直接使用命令行运行脚本

octave plot.m

可以从http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=DeepLearning&doc=exercises/ex2/ex2.html

下载数据集

我已根据网站建议安装了图片包。

我的操作系统是ubuntu 14.04,我不确定是否遗漏了什么。

我感谢任何帮助。

谢谢!

1 个答案:

答案 0 :(得分:2)

我找到了答案,可以在Octave常见问题解答中找到。

http://wiki.octave.org/FAQ

If you are running an Octave script that includes a plotting command,
the script and Octave may terminate immediately. So the plot window
does show up, but immediately closes when Octave finishes execution.
Alternatively, if using fltk, the plot window needs a readline loop to
show up (the time when Octave is sitting around doing nothing waiting for interactive input).
A common solution is to put a pause command at the end of your script.

所以我只是在我的脚本末尾添加pause并显示窗口。