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 plot3 command

Overview

In this tutorial, we will learn about the Octave plot3 command. The plot3 is an in-built function to produce 3D plots in Octave.

To generate a 2D plot, we can use the plot command. To know more about the plot command:

https://www.testingdocs.com/octave-plot-command/

Syntax

The simplest function call is:

>> plot3(x,y,z);

where x, y, and z can be scalars, vectors, and matrices of the same length.

There are many different combinations of arguments to this command. To know we can use the help command.

>> help plot3

If the arguments are scalars the arguments are taken to be the vertices of the point to be plotted in three dimensions. If the arguments are vectors a continuous line plot would be generated in three dimensions.

The plot3 command will plot the (x,y,z) coordinates with the default blue line.

Example

Let’s demonstrate the usage of the command with a simple three-dimensional plot of the Helix curve. A helix is a curve that resembles a spiral staircase.

Octave Script

% Octave plot3 3D plot Demo
% Octave Tutorials – www.TestingDocs.com

clear all;

clf;

% Generate z vector
z = [0:0.05:10*pi];
% Plot3 command
plot3 (sin(z),cos(z),z);
% 3D plot axis labels
xlabel(“x”);
ylabel(“y”);
zlabel(“z”);
legend (“Parametric Curve 3D Plot”);
title (“plot3() demo – www.TestingDocs.com”);

 

Screenshot

Octave Plot3 Command

3D plot

Octave plot3 command Output

—

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 /

Octave plot example of function y=x^2

‹ Three-dimensional plots using Octave› Octave 2D pie Chart

Recent Posts

  • Update draw.io on Windows
  • 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