English 中文(简体)
八月拒绝处理穿透镜头
原标题:Octave refuses to deal with the strings i pass to csvread()
  • 时间:2012-01-13 02:56:40
  •  标签:
  • octave

因此,我正在撰写一份十月文稿(我相对不懂语言),我正试图打开两卷剪辑,把我的名字交给我的文字,作为指挥线。 这里是我的文字:

    #!/usr/bin/env octave

    function plotregs(fig, regs)
      figure(fig);
      title( Foo );
      xlabel( Value );
      ylabel( Cycle # );
      grid on;

      plot(rows(regs(:, 1)), regs(:, 1),
           rows(regs(:, 2)), regs(:, 2),
           rows(regs(:, 3)), regs(:, 3),
           rows(regs(:, 4)), regs(:, 4),
           rows(regs(:, 5)), regs(:, 5),
           rows(regs(:, 6)), regs(:, 6),
           rows(regs(:, 7)), regs(:, 7),
           rows(regs(:, 8)), regs(:, 8));

      legend( A ,  B ,  C ,  D ,  E ,  F ,  H ,  L );
    endfunction  

    args = argv ();
    filename = strcat(cellstr(args(1)));
    typeinfo filename
    regs = csvread(filename);

    graphics_toolkit("gnuplot");

    plotregs(1, regs);

    filename = strcat(cellstr(args(2)));
    regs = csvread(filename);

    plotregs(2, regs);

    pause

And here is the output I get when I run the script:

    ans = sq_string
    error: dlmread: FILE argument must be a string or file id
    error: called from:
    error:   /usr/share/octave/3.4.3/m/io/csvread.m at line 34, column 5
    error:   /home/tnecniv/Code/Octave/regigraph/regigraph.m at line 25, column 6

任何建议都会得到赞赏。

问题回答

问题是,你撰写一份可起诉的书状,希望提出论点,但没有提供任何论点。

首先,我将开始档案。

#!/usr/bin/octave -qf

然后,可以操作文字。

$ ./myscript.sh datafile1.csv datafile2.csv

But in my opinion argv() behaves a bit strange, because when no arguments are given to -say myscript.sh-, it returns the filename of the executing script, but when one or more arguments are given it contains the arguments only.

您可参阅文件第2.6节“可执行的方案”。





相关问题
octave: load many functions from single file

How can I put multiple functions in one file and later get access to all of them in the octave interpreter ? I don t want to have a thousand files and want to group functions together. I d like ...

Graph Formatting Tools For Octave

I know that Matlab allows for you to format the graph after its created through the interface. However there isn t the same features in Octave. Is there a tool that goes between Octave and GnuPlot? If ...

How to add vectors with different length?

I would like to add two vectors with different lengths in Matlab or Octave. E.g. aa = [1 2 3 4]; bb = [100 100]; Which should result in a vector cc containing cc = [101 102 3 4] Can anyone figure ...

Octave Errors in attempting to study Image Compression

Let me start by saying I LOVE YOU. Thank you. Next order of business: octave-3.2.3:8> xin = imread( 3Phone.png ); octave-3.2.3:9> colormap(gray(256)); octave-3.2.3:10> image(xin); error: ...

Condensing Stock Data

I have a data set that is composed as such: 2009,11,01,17,00,23,1.471700,1.472000 2009,11,01,17,01,04,1.471600,1.471900 2009,11,01,17,01,09,1.471900,1.472100 2009,11,01,17,01,12,1.472000,1.472300 ...

Computing object statistics from the second central moments

I m currently working on writing a version of the MATLAB RegionProps function for GNU Octave. I have most of it implemented, but I m still struggling with the implementation of a few parts. I had ...

热门标签