help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: displaying an image


From: lana frankle
Subject: Re: displaying an image
Date: Fri, 11 Sep 2015 22:02:20 -0700

Octave is giving me the following error while I'm trying to do 2-D plotting:

>> y=((x+5).^2)/(4+3*x.^2)
y =  1.5625
>> figure plot(X,Y)
error: figure: N must be figure handle or figure number
error: called from
    figure at line 67 column 7

I'm not sure what it means.  Where do I put the "N"?

On Fri, Sep 4, 2015 at 8:03 AM, Mike Miller <address@hidden> wrote:
On Thu, Sep 3, 2015 at 12:43:15 -0700, lana frankle wrote:
> Do you know if those errors (the lack of space for help and doc and the
> colon instead of the semicolon) are correct for MATLAB, just not Octave?  Or
> are they just errors?

Ending a line with a colon is simply invalid syntax, in both Matlab and Octave.

Note the "lack of space" is not an error, it's the difference between
these two commands

  >> help(imagesc)
  >> help imagesc

It's not the space that matters, it's the parentheses around the
arguments. The first form is calling the imagesc() function with no
arguments (which is what produces the error you see) and then attempts
to pass the return value to the help function.

The second form is the same as

  >> help("imagesc")

See https://www.gnu.org/software/octave/doc/interpreter/Commands.html

Hope that clears things up,

--
mike


reply via email to

[Prev in Thread] Current Thread [Next in Thread]