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

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com