TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Octave

Octave plot example of function y=x^2

Introduction

In this tutorial, we will go through the steps involved to write a simple script to plot data using the Octave application. Let’s take a sample function

 

\huge f(x) = x^{2}

or

\huge y = x^{2}

 

Plot example

All the script commands should be placed in a file with .m extension.  To create a script file

Editor >> File >> Save File >> <filnename>.m

 

Give a name to the script file and save the file.

Add the script code.

Script

% TestingDocs.com Tutorials
% Simple plot example y = x^2
x=linspace(1,10,10);
y= x.^2;
figure
plot(x,y);
xlabel('x')
ylabel('y')
title('Simple plot - www.TestingDocs.com')

 

 

Simple Plot Example

linspace

linspace is a built-in function that returns a row vector with n linearly spaced elements between the specified interval parameters.

 

—

Octave Tutorials

Octave Tutorial on this website can be found at:
https://www.testingdocs.com/octave-tutorial/

More information on Octave can be found on the official website:
https://www.gnu.org/software/octave/index

Related Posts

Octave Package List

Octave /

Install Octave Packages on Linux

Octave /

Octave User defined Function Example

octave command line linux

Octave /

Octave Command line on Ubuntu

Hello World in Octave

Octave /

Hello World in Octave

Octave Install Ubuntu Linux

Octave /

Install Octave on Ubuntu Linux

‹ Install Octave on Ubuntu Linux› Hello World in Octave

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version