简体   繁体   中英

error: 'spdiag' undefined near line

I am introducing into Octave programming and I am interested in defining an sparse matrix as here , so I have the following code:

  spdiag ([1, 2, 3], 1)

And I got the error "error: 'spdiag' undefined near line 1 column 1"

I understand that for some reason the Octave build-in function spdiag cannot be found but I do not understand whether I have to include some Octave module and/or set some environmental variable in order to make it work.

I would really appreciate some help.

By the way I am working under Ubuntu 13.10 and the octave version is 3.6.4.

The manual you are reading for a very very old version of Octave. If you go to the main page , you'll notice this is the manual for version 3.0.2 and released in August 2008. The function spdiag was deprecated in version 3.2.0 and removed in 3.6.0.

If you use the Octave website, you will always get the latest version of the manual. In addition, the manual in both html and pdf forms is part of the Octave installation. Since you are using Ubuntu, you can install the package octave-doc to get the manual for the same version you have installed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM