Share to: share facebook share twitter share wa share telegram print page

GNU Octave

GNU Octave
GNU Octave 4.3.0+ running on Linux
GNU Octave 4.3.0+ running on Linux
開發者John W. Eaton and many others[1]
首次发布1988年,​36年前​(1988
当前版本
  • 9.1.0 (2024年3月14日;穩定版本)[2]
編輯維基數據鏈接
源代码库 編輯維基數據鏈接
编程语言C, C++, Fortran[3]
语言19种语言[來源請求]
类型科学计算
许可协议GNU GPLv3
网站www.gnu.org/software/octave/ 编辑维基数据

GNU Octave是一种采用高级编程语言的主要用于数值分析的软件。Octave有助于以数值方式解决线性和非线性问题,并使用与MATLAB兼容的语言进行其他数值实验。它也可以作为面向批处理的语言使用。因为它是GNU計劃的一部分,所以它是GNU通用公共许可证条款下的自由软件

Octave是MATLAB的主要自由替代品之一,其他还有ScilabFreeMat[5][6][7][8] 然而,与Octave相比,Scilab更少强调与MATLAB的(双向)句法兼容性。[5][9][10]


歷史

系統性開發則是由John W. Eaton在1992年接手才開始的。 第一個alpha測試版是在1993年1月4日釋出,1.0穩定版則是在1994年2月17日釋出[11]

其名稱與音樂上的八度沒有直接關係。該軟體乃是以一位早期開發群的成員,同時也以敏於處理數值逼近問題著稱的前化工系教授奧克塔夫·列文斯比爾(Octave Levenspiel)之名命名的。

技術細節

Octave語言

Octave語言是直譯式結構化(類於第二代的BASIC)的程式語言,支援許多C語言風格的標準函式功能,同時可以使用UNIX的系統呼叫以進行擴充增進功能,但不支援以引用的方式傳遞參數。

Octave的核心由一組內建的(built-in)矩陣運算語言(如四則運算)和可載入函式(Loadable Function)組成(例如求矩陣逆inv),其餘能在核心語言之上實現而且性能開銷不會顯著增加的函式呼叫則一般以Octave腳本的形式存在(例如求解方程組的fsolve函數)。Octave 解释器會自動處理各種不同類型的調用。

Octave支援資料建構,也支持基本的物件導向編程,但通常仍把它當作面向過程程序設計語言來看待。

它的語法基本上與Matlab一致,嚴謹編寫的程式碼應同時可在Matlab及Octave執行。但若調用了Matlab工具包,則一般不能直接在Octave上運行,因爲Octave附帶的工具包與Matlab並不兼容。

由於Octave是以GNU通用公共許可證授權,所以可以自由地複製、流通與使用。Octave可在大部份的類Unix作業系統中執行,亦可在Microsoft Windows中執行。在Mac OS X中運行也是可能的,但設置較爲複雜。[12]

特殊功能

變數及函式名稱自動補齊

在命令列按下TAB鍵,Octave會自動補齊變數,函式或檔案的名稱。Octave會依據游標之前的文字來補齊。

指令回溯

在互動模式下,Octave會將歷次指令存在暫存檔中以俟呼叫與編輯。

資料建構:

Octave包含了初步的資料建構功能,例如:

octave:1> x.a = 1; x.b = [1, 2; 3, 4]; x.c = "string";
octave:2> x.a
x.a = 1
octave:3> x.b
x.b =

  1  2
  3  4

octave:4> x.c
x.c = string
短路邏輯算符:

Octave的`&&'及`||'的邏輯算符是在短路的方式下運算(如同C語言中的相仿算符),相反於逐算子算符`&'及`|'。

遞增與遞減算符

Octave如同C語言一樣具有可前置或後置的遞增與遞減算符。

例外處理:

Octave以提供初步的LISPunwind_protect例外處理模式。通常unwind_protect表述區段英语Statement block可表示如下:

unwind_protect
  body
unwind_protect_cleanup
  cleanup
end_unwind_protect
可變長度參數表列:

Octave提供用於處理未指明參數個數時的函式呼叫機制:利用特殊的varargin作為參數來呼叫函式。

function s = plus(varargin)
  if(nargin==0)
   s = 0;
  else
   s = varargin{1} + plus (varargin{2:nargin});
  endif
endfunction
可變長度回傳表列:

單一函式可以varargout這一特殊回傳值來回傳任意數目的值,例如:

function varargout = multiassign(data)
  for k=1:nargout
   varargout{k} = data(:,k);
  endfor
endfunction

MATLAB相容性

Octave最初便是模彷Matlab而設計,自然與Matlab有許多相同的功能。这也使得一部分Matlab程序可以直接或经过少量修改在Octave上运行,一些软件开发小组也使用两者兼容的语法,直接开发可以同时在Matlab和Octave使用的程序。

  1. 矩陣為基礎資料型別之一
  2. 內建支援複數
  3. 內建功能強大的數學函式及可擴充的函式庫
  4. 使用者可自定函式

参见

参考文献

  1. ^ Rik. contributors.in. 10 June 2015 [14 June 2015]. (原始内容存档于2022-04-10). 
  2. ^ GNU Octave 9.1.0 Released. 2024年3月14日 [2024年3月18日]. 
  3. ^ Building - Octave. wiki.octave.org. GNU. [1 May 2018]. (原始内容存档于2020-07-06) (英语). 
  4. ^ GNU Octave 7.2.0 Released. 2022-07-28 [2022-07-28]. (原始内容存档于2022-08-06). 
  5. ^ 5.0 5.1 Trappenberg, Thomas. Fundamentals of Computational Neuroscience. Oxford University Press. 2010: 361. ISBN 978-0-19-956841-3. 
  6. ^ Muhammad, A; Zalizniak, V. Practical Scientific Computing. Woodhead Publishing. 2011: 3. ISBN 978-0-85709-226-7. 
  7. ^ Megrey, Bernard A.; Moksness, Erlend. Computers in Fisheries Research. Springer Science & Business Media. 2008: 345. ISBN 978-1-4020-8636-6. 
  8. ^ Kapuno, Raul Raymond. Programming for Chemical Engineers Using C, C++, and MATLAB. Jones & Bartlett Publishers. 2008: 365. ISBN 978-1-934015-09-4. 
  9. ^ Herman, Russell L. A Course in Mathematical Methods for Physicists. CRC Press. 2013: 42. ISBN 978-1-4665-8467-9. 
  10. ^ Wouwer, Alain Vande; Saucez, Philippe; Vilas, Carlos. Simulation of ODE/PDE Models with MATLAB, Octave and Scilab: Scientific and Engineering Applications. Springer. 2014: 114–115. ISBN 978-3-319-06790-2. 
  11. ^ About Octave. [2010-11-21]. (原始内容存档于2021-01-25). 
  12. ^ Installing MacOS X Bundle. GNU Octave. [2012-03-12]. (原始内容存档于2012-06-25). 

外部連結

Read more information:

Canadian roadside attraction The World's Largest LobsterArtistWinston BronnumYear1990TypeConcrete statueLocationShediac, New BrunswickOwnerTown of Shediac The World's Largest Lobster (French: Le plus grand homard du monde) is a concrete and reinforced steel statue in Shediac, New Brunswick, Canada sculpted by Canadian artist Winston Bronnum. The statue is 11 metres long and 5 metres tall, weighing 90 tonnes.[1] The sculpture was commissioned by the Shediac Rotary Club as a tribute to the…

Эксперимент: Злоангл. The Quiet Ones Жанр ужасы Режиссёр Джон Пог  (англ.) (рус. Продюсеры Тобин АрмрустДжеймс Гэй-РисБен Холден и др. Авторысценария Крэйг РозенбергОрен МуверманДжон Пог В главныхролях Джаред ХаррисОливия КукСэм КлафлинЭрин Ричардс Оператор Матьяш …

Paulo Porto Personal informationFull name Paulo Francisco da Silva PortoDate of birth (1951-09-27) 27 September 1951 (age 72)Place of birth Taquari, BrazilTeam informationCurrent team Inter de Lages[1]Managerial careerYears Team1998 Pinheiros-RS1999 Taquariense2000–2001 Glória2001–2002 Guarani de Venâncio Aires2002 São José de Cachoeira do Sul2002 Clube Atlético Lages2003 Marcílio Dias2004 São José de Cachoeira do Sul2004 Clube Atlético Lages2004–2005 Esportivo2005 Ju…

روبن لود   معلومات شخصية الميلاد 17 أبريل 1993 (العمر 30 سنة)هلسنكي، فنلندا الطول 1.80 م (5 قدم 11 بوصة) مركز اللعب لاعب وسط / جناج الجنسية فنلندا  معلومات النادي النادي الحالي مينيسوتا يونايتد الرقم 17 مسيرة الشباب سنوات فريق 1999–2006 نادي سومو 2006–2011 هلسنكي المسيرة الاحترا

South Korean entertainment company For the artist, see J. Y. Park. JYP Entertainment CorporationNative nameJYP 엔터테인먼트TypePublicTraded asKRX: 035900IndustryEntertainmentretailGenreK-popR&BEDMtrotFoundedApril 25, 1997; 26 years ago (1997-04-25)FounderJ. Y. ParkHeadquartersGangdong, Seoul, South KoreaArea servedWorldwideKey peopleJimmy Jeong (CEO)ServicesArtist managementConcert production companyEvent managementMusic productionMusic publishing companyRecord distri…

Stream of ConsciousnessLagu oleh Dream Theaterdari album Train of ThoughtDirilis2003Genre Progressive metal Instrumental Durasi11:16LabelElektra RecordsKomponis musikJohn Petrucci, John Myung, Jordan Rudess, Mike PortnoyProduserMike Portnoy, John Petrucci Stream of Consciousness adalah lagu dari band progressive metal Dream Theater, muncul di album mereka pada tahun 2003 Train of Thought. Panjang lagu ini 11 menit 16 detik. Lagu ini muncul sebagai lagu keenam di album, sebagai kelanjutan langsun…

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Oktober 2022. Papyrus Oxyrhynchus 5101 Papyrus Oxyrhynchus 5101, (ditunjuk sebagai P.Oxy.LXXVII 5101, LDAB 140272 atau Rahlfs 2227) adalah gulungan papirus yang sekarang hanya bertahan sebagai potongan kecil. Itu ditulis dalam bahasa Yunani Koine dari Septuaginta (LXX)…

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (أغسطس 2023) هذه مقالة غير مراجعة. ينبغي أن يزال هذا القالب بعد أن يراجعها محرر مغاير للذي أنشأها؛ إذا لزم الأمر فيجب أن ت…

American reality television series Bill Murray & Brian Doyle-Murray's Extra InningsGenre Reality Sports Comedy Starring Bill Murray Brian Doyle-Murray Opening themeThe Thing About Baseball by Bill MurrayCountry of originUnited StatesOriginal languageEnglishNo. of seasons1No. of episodes10ProductionExecutive producers Dub Cornett Bill Murray Brian Doyle-Murray ProducerVictoria Lily ShafferCinematographyAnna SchwaberEditorJack AlvinoRunning time9–11 minutesProduction companyOso StudiosOrigin…

Cmentarz Centralny w Szczecinie nr rej. 1066/ZWKZ z 16 czerwca 1986 Cmentarz Centralny w Szczecinie Poprzednie nazwy Hauptfriedhof (1901-45) Państwo  Polska Miejscowość Szczecin Adres ulica Ku Słońcu (brama główna) Typ cmentarza komunalny[a] Stan cmentarza czynny Powierzchnia cmentarza 172,33 ha Liczba pochówków ponad 300 tys. Data otwarcia 6 grudnia 1901 Zarządca Zakładu Usług Komunalnych w Szczecinie Architekt Wilhelm Meyer-Schwartau Położenie na mapie SzczecinaCmentarz Cent…

British English language pay TV channel For the Canadian television channel, see Vivid TV Canada (English). This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Vivid TV Europe – news · newspapers · books · scholar · JSTOR (November 2017) (Learn how and when to remove this template message) Television channel V…

This is a dynamic list and may never be able to satisfy particular standards for completeness. You can help by adding missing items with reliable sources. This is a list of armed conflicts in South America. Development of Spanish America  Government under traditional Spanish law  Loyal to Supreme Centre Cortes  American junta or insurrection movement  Independent state declared or established  Height of French control of the Peninsula Argentina c…

Constitutional monarchy as a system of government in Saint Kitts and Nevis King of Saint Kitts and NevisFederalCoat of arms of Saint Kitts and NevisIncumbentCharles IIIsince 8 September 2022 DetailsStyleHis MajestyHeir apparentWilliam, Prince of WalesFirst monarchElizabeth IIFormation19 September 1983 Politics of Saint Kitts and Nevis Executive Monarch Charles III Governor-General Marcella Liburd Prime Minister Terrance Drew Deputy Prime Minister Geoffrey Hanley Legislative National As…

Gracefield Arts CentreLocation within ScotlandLocation28 Edinburgh Rd, Dumfries DG1 1JQ, United KingdomWebsitehttps://www.visitscotland.com/info/see-do/gracefield-arts-centre-p249481 Gracefield Arts Centre is located in Dumfries. The gallery's main building, a Category B listed building, was bought in 1951 by a committee of local people who raised the money needed for the purchase and to do the alterations necessary to change the former house, which was known as ‘Gracefield’ into an art gall…

Голова Європейського Союзу — термін, який має кілька значень. Ця сторінка значень містить посилання на статті про кожне з них.Якщо ви потрапили сюди за внутрішнім посиланням, будь ласка, поверніться та виправте його так, щоб воно вказувало безпосередньо на потрібну статтю…

Japanese manga series Fairy Tail: 100 Years QuestCover of the first tankōbon volume of Fairy Tail: 100 Years QuestGenreAdventure, fantasy[1] MangaWritten byHiro Mashima[a]Illustrated byAtsuo UedaPublished byKodanshaEnglish publisherNA: Kodansha USAImprintShōnen Magazine ComicsMagazineMagazine PocketDemographicShōnenOriginal runJuly 25, 2018 – presentVolumes16 (List of volumes) Anime television series Fairy Tail: 100 Years Quest is a Japanese manga series writt…

  لمعانٍ أخرى، طالع جنكيز خان (توضيح). جنكيز خانGenghis Khanمعلومات عامةالصنف الفني فيلم سيرة ذاتيةتاريخ الصدور 1965مدة العرض 128 دقيقة اللغة الأصلية لغة إنجليزيةالبلد ألمانيا، يوغوسلافيا، المملكة المتحدةالطاقمالمخرج Henry Levin (en) [1][2][3] السيناريو بيفيرلي كروس البطول…

City area This article is about Central Business District of Jakarta. For other uses, see Golden Triangle (disambiguation). The Golden Triangle of Jakarta (Indonesian: Segitiga Emas Jakarta) or can also be referred to as Medan Merdeka–Thamrin–Sudirman Axis (Indonesian: Poros Medan Merdeka–Thamrin–Sudirman) or Sudirman–Thamrin–Kuningan Axis (Indonesian: Poros Sudirman–Thamrin–Kuningan), is a roughly triangular area in the center of Jakarta, Indonesia, extending from Central Jakart…

Anton Bachrul AlamKepala Kepolisian Daerah Jawa TimurMasa jabatan20 Februari 2009 – 30 Oktober 2009PendahuluHerman S. SumawiredjaPenggantiPratiknyoKepala Divisi Humas PolriMasa jabatan28 Desember 2010 – 28 Oktober 2011PendahuluIskandar HasanPenggantiSaud Usman NasutionKepala Kepolisian Daerah Kalimantan SelatanMasa jabatan14 Mei 2008 – 20 Februari 2009PendahuluHalba Rubis NugrohoPenggantiUntung Suharsono RadjabKepala Kepolisian Daerah Kepulauan Riau ke-1Masa …

Australian rugby league club, based in Townsville QLD North Queensland Young GunsClub informationFull nameNorth Queensland Young Guns Rugby League Football ClubNickname(s)The Young Guns,ColoursPrimary:  Navy  Grey   YellowSecondary:   WhiteFounded1998Current detailsGround(s)Dairy Farmers Stadium (22,500)CEOPeter ParrCaptainDaniel StricklandCompetitionQueensland Cup20153rd Current seasonRecordsPremierships1 (2005) The North Queensland Young Guns were a rugby league team compet…

Kembali kehalaman sebelumnya

Lokasi Pengunjung: 18.232.179.191