MATLAB fimplicit3 in MATLAB®

Learn how to make 4 fimplicit3 charts in MATLAB, then publish them to the Web with Plotly.


Plot 3-D Implicit Function

Plot the hyperboloid x2+y2-z2=0 over the default interval of [-5,5] for x, y, and z.

f = @(x,y,z) x.^2 + y.^2 - z.^2;
fimplicit3(f)

fig2plotly()

Specify Plotting Interval

Plot the upper half of the hyperboloid x2+y2-z2=0 by specifying the plotting interval as [0 5] for z. For x and y, use the default interval [-5 5].

f = @(x,y,z) x.^2 + y.^2 - z.^2;
interval = [-5 5 -5 5 0 5];
fimplicit3(f,interval)

fig2plotly()

Modify Appearance of Implicit Surface

Plot the implicit surface x2+y2-z2=0. Remove the lines by setting the EdgeColor property to 'none'. Add transparency by setting the FaceAlpha property to a value between 0 and 1.

f = @(x,y,z) x.^2 + y.^2 - z.^2;
fimplicit3(f,'EdgeColor','none','FaceAlpha',.5)

fig2plotly()

Modify Implicit Surface After Creation

Plot an implicit surface and assign the implicit surface object to the variable fs.

f = @(x,y,z) 1./x.^2 - 1./y.^2 + 1./z.^2; fs = fimplicit3(f)

fs = 
  ImplicitFunctionSurface with properties:

     Function: @(x,y,z)1./x.^2-1./y.^2+1./z.^2
    EdgeColor: [0 0 0]
    LineStyle: '-'
    FaceColor: 'interp'

  Show all properties

Use `fs` to access and modify properties of the implicit surface after it is created. For example, show only the positive x values by setting the `XRange` property to `[0 5]`. Remove the lines by setting the `EdgeColor` property to `'none'`. Add transparency by setting the `FaceAlpha` property to `0.8`.
fs.XRange = [0 5];
fs.EdgeColor = 'none';
fs.FaceAlpha = 0.8;

fig2plotly()