octave linux下安装运行问题

1安装gnuplot用于plot画图

https://sourceforge.net/projects/gnuplot/files/gnuplot/


2安装octave

https://octave.en.softonic.com/download


3 运行时plot错误

octave:1> x = [1 4 90]
x =


    1    4   90


octave:2> plot(x)
error: popen2: popen2 (child): unable to start process -- No such file or directory
error: called from:
error: octave-3.8.1/scripts/plot/util/private/__gnuplot_open_stream__.m at line 30, column 40
error: octave-3.8.1/scripts/plot/util/__gnuplot_drawnow__.m at line 72, column 19
sh: 1: : Permission denied
error: 'unset' undefined near line 1 column 1
warning: broken pipe

octave-3.8.1/scripts/plot/util/private/__gnuplot_open_stream__.m

进行临时修改:


 27 function plot_stream = __gnuplot_open_stream__ (npipes, h)
 28   [prog, args] = gnuplot_binary ();
 29   if (npipes > 1)
 30     [plot_stream(1), plot_stream(2), pid] = popen2 ("gnuplot", args{:});
 31     if (pid < 0)
 32       error ("__gnuplot_open_stream__: failed to open connection to gnuplot");
 33     else
 34       plot_stream(3) = pid;
 35     endif
 36   else
 37     plot_stream = popen (sprintf ("%s ", prog, args{:}), "w");
 38     if (plot_stream < 0)
 39       error ("__gnuplot_open_stream__: failed to open connection to gnuplot");
 40     endif
 41   endif
 42   if (nargin > 1)
 43     set (h, "__plot_stream__", plot_stream);
 44   endif
 45 endfunction

也可以设定(gnuplot_binary()为具体的plot执行体)

octave:1> gnuplot_binary ('gnuplot');
octave:2> x = [1 30 980]
x =

     1    30   980

octave:3> plot(x)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值