help-octave
[Top][All Lists]
Advanced

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

Re: Editor education


From: Nicholas Jankowski
Subject: Re: Editor education
Date: Sun, 30 Aug 2015 15:29:41 -0400

On Sun, Aug 30, 2015 at 11:34 AM, Daniel Collins <address@hidden> wrote:

Hi Folks,

 

            O.K. I’m still learning to use Octave 3.6.4 with Windows 7.  Recently, after entering the Octave 3.6.4 interpretor, I typed:

 

Function call

After typing some of the elements, I typed:

 

Endfunction

And Octave returned me to the interpretor prompt.  I then typed:

 

Save c:\users\daniel\documents\finance\call

And Octave apparently accepted the command with no complaints.  I then exited Octave, and then re-entered to the interpretor.  I typed the following:

 

Load c:\users\daniel\documents\finance\call

 

This created an Octave error; Octave said that it couldn’t find the file.  I then exited Octave and went into Notepad++.  There, I opened call under “all files” and it came up in Notepad++ as nothing more than the following:

 

# Created by Octave 3.6.4, Sun Aug 30 09:08:11 2015 Eastern Daylight Time <address@hidden>

 

I simply don’t understand where or how I went wrong.  What did I miss?  By the way, I assume that Octave scripts and functions are saved as text files, is that not correct?  For my own edification, in what format are scripts and functions saved?  Thanks for any help that is offered.

-djc

 



first, 3.6.4 is a bit outdated. Version 4.0.0 is available for Windows and works fairly well. It adds a GUI and built in script/function editor which makes things a bit more straight forward.

It seems like you may have an incorrect understanding of how Octave works.

The save and load commands are not for saving and loading functions/scripts. they save the variables, etc. created during a session. (try typing 'help save', or 'help load') Functions/scripts are written in an editor, and saved as text files. in your case, written in Notepad++ i guess, although any text editor will do. Octave 4.0.0 includes an editor with debugging capabilities. It's sort of like programming. The program is a text file, the compiler processing this text file to do things.

functions and scripts are saved as m-files  (filename.m)  which are simply text files with a list of  function or script commands.  (scripts are literally just lists of commands that will be executed in order. functions have a different, specific syntax, see 'help function').


Hope this helps you get started,

Nick J.



reply via email to

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