Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU Octave
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=={{anchor|MATLAB}} MATLAB compatibility== Octave has been built with MATLAB compatibility in mind, and shares many features with MATLAB: # Matrices as fundamental data type. # Built-in support for complex numbers. # Powerful built-in math functions and extensive function libraries. # Extensibility in the form of user-defined functions. Octave treats incompatibility with MATLAB as a [[Bug (software)|bug]]; therefore, it could be considered a [[software clone]], which does not infringe [[software copyright]] as per ''[[Lotus v. Borland]]'' court case. MATLAB scripts from the [[MathWorks]]' FileExchange repository in principle are compatible with Octave. However, while they are often provided and uploaded by users under an Octave [[License compatibility|compatible]] and proper [[open-source license|open source]] [[BSD license]], the FileExchange [[EULA|Terms of use]] prohibit any usage beside MathWorks' [[proprietary software|proprietary]] MATLAB.<ref>{{Cite web |title=FAQ - Octave |url=https://wiki.octave.org/FAQ |access-date=2022-12-05 |website=wiki.octave.org}}</ref><ref>{{Cite web |title=MATLAB Central Terms of Use |url=https://www.mathworks.com/matlabcentral/content/terms-of-use.html |access-date=2022-12-05 |website=www.mathworks.com |language=en}}</ref><ref>{{Cite web |title=File Exchange Licensing FAQ |url=https://www.mathworks.com/matlabcentral/content/fx/fx-transition-faq.html |access-date=2022-12-05 |website=www.mathworks.com |language=en}}</ref> ===Syntax compatibility=== There are a few purposeful, albeit minor, [http://octave.org/wiki/index.php?title=FAQ#Porting_programs_from_Matlab_to_Octave syntax additions] {{Webarchive|url=https://web.archive.org/web/20120426060857/http://octave.org/wiki/index.php?title=FAQ#Porting_programs_from_Matlab_to_Octave |date=2012-04-26 }}: # [[Comment (computer programming)|Comment]] lines can be prefixed with the # character as well as the % character; # Various [[C (programming language)|C-based]] operators [[Increment operator|++]], [[Decrement operator|--]], [[Augmented assignment|+=]], *=, /= are supported; # Elements can be referenced without creating a new variable by cascaded indexing, e.g. [1:10](3); # [[String (computer science)|String]]s can be defined with the double-quote " character as well as the single-quote ' character; # When the variable type is [[Single-precision floating-point format|single]] (a single-precision floating-point number), Octave calculates the "[[mean]]" in the single-domain (MATLAB in [[Double-precision floating-point format|double-domain]]) which is faster but gives less accurate results; # Blocks can also be terminated with more specific [[Control structure]] keywords, i.e., endif, endfor, endwhile, etc.; # Functions can be defined within scripts and at the Octave prompt; # Presence of a do-until loop (similar to [[Do while loop|do-while]] in C). ===Function compatibility=== Many, but not all, of the numerous MATLAB functions are available in GNU Octave, some of them accessible through packages in [https://octave.sourceforge.io Octave Forge]. The functions available as part of either core Octave or Forge packages are listed [https://octave.sourceforge.io/list_functions.php?q=&sort=alphabetic online] {{Webarchive|url=https://web.archive.org/web/20240314051049/https://octave.sourceforge.io/list_functions.php?q=&sort=alphabetic |date=2024-03-14 }}. A list of unavailable functions is included in the Octave function [http://hg.savannah.gnu.org/hgweb/octave/file/tip/scripts/help/__unimplemented__.m <code>__unimplemented.m__</code>]. Unimplemented functions are also listed under many Octave Forge packages in the [https://wiki.octave.org/Category:Octave_Forge Octave Wiki]. When an unimplemented function is called the following error message is shown: <syntaxhighlight lang="octave"> octave:1> guide warning: the 'guide' function is not yet implemented in Octave Please read <http://www.octave.org/missing.html> to learn how you can contribute missing functionality. error: 'guide' undefined near line 1 column 1 </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)