SlideShare a Scribd company logo
3
Most read
4
Most read
18
Most read
CONTENTS
 Introduction
 History
 Issues of matlab users
 Technical Details
 Some useful OCTAVE commands
 Introduction to Matrix
 Array , Vector and Matrix
 Plotting
 Functions
 Scripts
 Difference between Matlab And Octave
INTRODUCTION
 High level programming language
 Open Source Implementation
 Available in Linux and Windows
 Distributed in GPL(Gnu Public License)
 Designed for matrix computations
HISTORY
The project was conceived around 1988 . At first it was
intended to be a companion to a chemical reactor design
course. Real development was started by John W. Eaton in
1992. The first alpha release dates back to January 4, 1993 and
on February 17, 1994 version 1.0 was released. Version 4.0.0
was released on May 29, 2015. The latest version 5.1.0 of GNU
octave was released on March 1,2019.
ISSUES FOR MATLAB USERS
Licensing – Octave is free
Multi-processor and cluster
64-bit systems and large memory (> 2GB)
Lack of GUI support
Compatibility/portability issues with other analysis packages (e.g., R)
Speed (we need to convert more .m files to C++)
TECHNICAL DETAILS
 Written in C++ using the C++ standard library.
 Uses an interpreter to execute the Octave scripting language.
 Octave interpreter has an OpenGL-based graphics engine to create
plots, graphs and charts and to save or print them.
 Octave includes a Graphical User Interface (GUI) in addition to the
traditional Command Line Interface (CLI).
SOME USEFUL OCTAVE COMMANDS
 who List Known variables
 whos List known variables plus their size
 help help in finding any command
 clear Clear all variables from workspace
 clear x y Clear variables x and y from workspace
 clc Clear the command windows
 ver Display the information of version of OCTAVE
 exit quit from OCTAVE session
INTRODUCTION TO MATRIX
Creating a Matrix
Simply type:
octave:1> A = [8, 2, 1; 3, -1, 4; 7, 6, -5]
Octave will respond with a matrix in pretty-print:
A =
8 2 1
3 -1 4
7 6 -5
Indexing
Always "row before column"!
aij = A(i,j) Get an element
r = A(i,:) Get a row
c = A(:,j) Get a column
B = A(i:k,j:l) Get a submatrix
Useful indexing command end :
octave:1> data = [4 -1 35 9 11 -2];
octave:2> v = data(3:end) ;
v =
35 9 11 -2
ARRAYS, VECTORS, AND MATRICES
Array :
A collection of data elements
arranged in rows and columns
C={1 , 2 , 3; 4 , 5 , 6};
Vector:
A one-dimensional array (single row or
single column of data elements)
Matrix :
A two-dimensional array (more than
one row and/or column of data
elements)
>> A=[1;9]
>> B=[1;8;3;7]
>> C=[1:3; 4:6; 7:9]
row or column?
column vector
C =
1 2 3
4 5 6
7 8 9
PLOTTING
Plotting in 2D
 plot(x,cos(x)) Display x,y-plot
Creates automatically a figure window. Octave uses gnu plot to
handle graphics.
 figure(n) Create figure window 'n'
If the figure window already exists, brings it into the foreground
(makes it the current figure)
 figure Create new figure window with
identifier incremented by 1
EXAMPLE OF PLOTTING
>> x=0:pi/100:2*pi;
>> y1=sin(2*x);
>> y2=2*cos(2*x);
>>plot(x,y1);
>> hold on;
>> plot(x,y2);
FREQUENT COMMANDS
▪ clf Clear figure
▪ hold on Hold axes. Don't replace plot with
new plot, superimpose plots
▪ grid on Add grid lines
▪ grid off Remove grid lines
▪ title('Exp1') Set title of figure window
▪ xlabel(‘label name ') Set label of x-axis
▪ ylabel(‘label name') Set label of y-axis
▪ subplot Put several plot axes into figure
LINE SPECIFIERS
Line Style Specifier
Solid(Default) -
Dashed --
Dotted .
Dash-dot -.
Line color Specifier
Red r
Green g
Blue b
Cyan c
Magenta m
Yellow y
Black k
White w
Ex : Find the response to an input of 5u(t).
Given that amplitude of step input is 5 .
Program:
Sys1=tf([1 1 ]*5,[4 4])
Sys2=tf([1]*5,[4 1])
Step(sys,1);
Hold on;
Step(sys,2)
FUNCTIONS
Functions and their m-File
▪ When putting a function into its m-file, the name of that file must be the
same as the function name plus the .m extension.
Examples: calcmoments.m, findfirstpeak.m
▪ To call a function, type its name without the .m extension. Example:
[bool i] = findfirstpeak(myreadings, 0.3);
▪ Comments in Octave/Matlab start with % .
SCRIPTS
Scripts
▪ The second type of m-files is called script. Again, Octave scripts
are text files with an
.m extension.
▪ Scripts contain executable code. They are basically the "main"
programs.
▪ Execute a script by typing its name without the .m extension!
Example: octave:1> LocalizeRobot
DIFFERENCE BETWEEN MATLAB AND
OCTAVE
The Basic Comparison
between Matlab vs Octave
Matlab Octave
Definition It is a matrix laboratory, referred
to as language used for technical
computing.
It is programming language used
for numerical computing.
Programmed It was written in C, C++ and Java
programming language.
It was written in C, C++ and
Fortran Language.
Interface It has better interface
comparatively.
Its interface is not that good as
MATLAB is having.
RAM It consumes more RAM as
compared to Octave.
It consumes less RAM than
MATLAB.
Free It is not free It is free
THANK YOU

More Related Content

PPTX
Presentation on Electric Vehicles
PPTX
Homogeneous Linear Differential Equations
PPTX
G20 ppt presentation
PDF
4 interest and equivalence
PPT
EST 130, Transistor Biasing and Amplification.
PPT
9780273716884 pp07 (1)
PDF
Mechanical Testing : Testing Of Materials
Presentation on Electric Vehicles
Homogeneous Linear Differential Equations
G20 ppt presentation
4 interest and equivalence
EST 130, Transistor Biasing and Amplification.
9780273716884 pp07 (1)
Mechanical Testing : Testing Of Materials

What's hot (20)

PPTX
Basic of octave matlab programming language
PPTX
Introduction to matlab lecture 1 of 4
PPTX
Python: The Iterator Pattern
PPSX
Matrix Manipulation in Matlab
PPTX
Input-Buffering
PDF
Introduction to Latex
PDF
Matlab-Data types and operators
PPT
Greedy Algorithms Huffman Coding.ppt
PPTX
Laplace transform
PDF
Kittel c. introduction to solid state physics 8 th edition - solution manual
PPTX
Matlab matrices and arrays
PPT
Introduction to matlab
PDF
pandas - Python Data Analysis
PDF
module5_backtrackingnbranchnbound_2022.pdf
PDF
Kalman filter for Beginners
PPTX
Robot operating system [ROS]
PDF
Intro to Neural Networks
PDF
Recursive Neural Networks
PPT
Basics & asymptotic notations
PDF
Distributed Database practicals
Basic of octave matlab programming language
Introduction to matlab lecture 1 of 4
Python: The Iterator Pattern
Matrix Manipulation in Matlab
Input-Buffering
Introduction to Latex
Matlab-Data types and operators
Greedy Algorithms Huffman Coding.ppt
Laplace transform
Kittel c. introduction to solid state physics 8 th edition - solution manual
Matlab matrices and arrays
Introduction to matlab
pandas - Python Data Analysis
module5_backtrackingnbranchnbound_2022.pdf
Kalman filter for Beginners
Robot operating system [ROS]
Intro to Neural Networks
Recursive Neural Networks
Basics & asymptotic notations
Distributed Database practicals
Ad

Similar to GNU octave (20)

PPT
sonam Kumari python.ppt
PPTX
PDF
Lecture1_computer vision-2023.pdf
PDF
Introduction to Matlab.pdf
PPT
4413-lecture-09 Introduction Matlab lecture .ppt
PPT
python.ppt
PPTX
Deep Learning, Scala, and Spark
PPTX
Matlab ppt
PDF
Control Systems Engineering_MATLAB Experiments.pdf
PDF
Control Systems Engineering_MATLAB Experiments.pdf
PPT
MATLAB-tutorial for Image Processing with Lecture 3.ppt
PPTX
python programming internship presentation.pptx
PDF
Matlab ch1 intro
PPTX
美洲杯投注-美洲杯投注外围投注-美洲杯投注外围投注平台|【​网址​🎉ac10.net🎉​】
PDF
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
PDF
class 12 computer science pdf of class e
PPTX
MATLAB Workshop for project and research
DOCX
PPT
Matlab1
PPT
MatlabIntro (1).ppt
sonam Kumari python.ppt
Lecture1_computer vision-2023.pdf
Introduction to Matlab.pdf
4413-lecture-09 Introduction Matlab lecture .ppt
python.ppt
Deep Learning, Scala, and Spark
Matlab ppt
Control Systems Engineering_MATLAB Experiments.pdf
Control Systems Engineering_MATLAB Experiments.pdf
MATLAB-tutorial for Image Processing with Lecture 3.ppt
python programming internship presentation.pptx
Matlab ch1 intro
美洲杯投注-美洲杯投注外围投注-美洲杯投注外围投注平台|【​网址​🎉ac10.net🎉​】
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
class 12 computer science pdf of class e
MATLAB Workshop for project and research
Matlab1
MatlabIntro (1).ppt
Ad

Recently uploaded (20)

PPTX
Construction Project Organization Group 2.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Project quality management in manufacturing
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Geodesy 1.pptx...............................................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Digital Logic Computer Design lecture notes
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Construction Project Organization Group 2.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
UNIT 4 Total Quality Management .pptx
Project quality management in manufacturing
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Foundation to blockchain - A guide to Blockchain Tech
Geodesy 1.pptx...............................................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
OOP with Java - Java Introduction (Basics)
Digital Logic Computer Design lecture notes
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Lecture Notes Electrical Wiring System Components
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS

GNU octave

  • 1. CONTENTS  Introduction  History  Issues of matlab users  Technical Details  Some useful OCTAVE commands  Introduction to Matrix  Array , Vector and Matrix  Plotting  Functions  Scripts  Difference between Matlab And Octave
  • 2. INTRODUCTION  High level programming language  Open Source Implementation  Available in Linux and Windows  Distributed in GPL(Gnu Public License)  Designed for matrix computations
  • 3. HISTORY The project was conceived around 1988 . At first it was intended to be a companion to a chemical reactor design course. Real development was started by John W. Eaton in 1992. The first alpha release dates back to January 4, 1993 and on February 17, 1994 version 1.0 was released. Version 4.0.0 was released on May 29, 2015. The latest version 5.1.0 of GNU octave was released on March 1,2019.
  • 4. ISSUES FOR MATLAB USERS Licensing – Octave is free Multi-processor and cluster 64-bit systems and large memory (> 2GB) Lack of GUI support Compatibility/portability issues with other analysis packages (e.g., R) Speed (we need to convert more .m files to C++)
  • 5. TECHNICAL DETAILS  Written in C++ using the C++ standard library.  Uses an interpreter to execute the Octave scripting language.  Octave interpreter has an OpenGL-based graphics engine to create plots, graphs and charts and to save or print them.  Octave includes a Graphical User Interface (GUI) in addition to the traditional Command Line Interface (CLI).
  • 6. SOME USEFUL OCTAVE COMMANDS  who List Known variables  whos List known variables plus their size  help help in finding any command  clear Clear all variables from workspace  clear x y Clear variables x and y from workspace  clc Clear the command windows  ver Display the information of version of OCTAVE  exit quit from OCTAVE session
  • 7. INTRODUCTION TO MATRIX Creating a Matrix Simply type: octave:1> A = [8, 2, 1; 3, -1, 4; 7, 6, -5] Octave will respond with a matrix in pretty-print: A = 8 2 1 3 -1 4 7 6 -5
  • 8. Indexing Always "row before column"! aij = A(i,j) Get an element r = A(i,:) Get a row c = A(:,j) Get a column B = A(i:k,j:l) Get a submatrix Useful indexing command end : octave:1> data = [4 -1 35 9 11 -2]; octave:2> v = data(3:end) ; v = 35 9 11 -2
  • 9. ARRAYS, VECTORS, AND MATRICES Array : A collection of data elements arranged in rows and columns C={1 , 2 , 3; 4 , 5 , 6}; Vector: A one-dimensional array (single row or single column of data elements) Matrix : A two-dimensional array (more than one row and/or column of data elements) >> A=[1;9] >> B=[1;8;3;7] >> C=[1:3; 4:6; 7:9] row or column? column vector C = 1 2 3 4 5 6 7 8 9
  • 10. PLOTTING Plotting in 2D  plot(x,cos(x)) Display x,y-plot Creates automatically a figure window. Octave uses gnu plot to handle graphics.  figure(n) Create figure window 'n' If the figure window already exists, brings it into the foreground (makes it the current figure)  figure Create new figure window with identifier incremented by 1
  • 11. EXAMPLE OF PLOTTING >> x=0:pi/100:2*pi; >> y1=sin(2*x); >> y2=2*cos(2*x); >>plot(x,y1); >> hold on; >> plot(x,y2);
  • 12. FREQUENT COMMANDS ▪ clf Clear figure ▪ hold on Hold axes. Don't replace plot with new plot, superimpose plots ▪ grid on Add grid lines ▪ grid off Remove grid lines ▪ title('Exp1') Set title of figure window ▪ xlabel(‘label name ') Set label of x-axis ▪ ylabel(‘label name') Set label of y-axis ▪ subplot Put several plot axes into figure
  • 13. LINE SPECIFIERS Line Style Specifier Solid(Default) - Dashed -- Dotted . Dash-dot -. Line color Specifier Red r Green g Blue b Cyan c Magenta m Yellow y Black k White w
  • 14. Ex : Find the response to an input of 5u(t). Given that amplitude of step input is 5 . Program: Sys1=tf([1 1 ]*5,[4 4]) Sys2=tf([1]*5,[4 1]) Step(sys,1); Hold on; Step(sys,2)
  • 15. FUNCTIONS Functions and their m-File ▪ When putting a function into its m-file, the name of that file must be the same as the function name plus the .m extension. Examples: calcmoments.m, findfirstpeak.m ▪ To call a function, type its name without the .m extension. Example: [bool i] = findfirstpeak(myreadings, 0.3); ▪ Comments in Octave/Matlab start with % .
  • 16. SCRIPTS Scripts ▪ The second type of m-files is called script. Again, Octave scripts are text files with an .m extension. ▪ Scripts contain executable code. They are basically the "main" programs. ▪ Execute a script by typing its name without the .m extension! Example: octave:1> LocalizeRobot
  • 17. DIFFERENCE BETWEEN MATLAB AND OCTAVE The Basic Comparison between Matlab vs Octave Matlab Octave Definition It is a matrix laboratory, referred to as language used for technical computing. It is programming language used for numerical computing. Programmed It was written in C, C++ and Java programming language. It was written in C, C++ and Fortran Language. Interface It has better interface comparatively. Its interface is not that good as MATLAB is having. RAM It consumes more RAM as compared to Octave. It consumes less RAM than MATLAB. Free It is not free It is free