Main Content

remove

R2026b

Remove component from optical system

Since R2026a

    Description

    Add-On Required: This feature requires the Optical Design and Simulation Library for Image Processing Toolbox add-on.

    remove(opsys) removes an incomplete surface from the optical system. If an incomplete surface does not exist, the function removes the last component. The positions of other components in the optical system remain unchanged.

    example

    remove(opsys,cInd) removes the component specified by the index cInd.

    example

    Examples

    collapse all

    Load a double Gauss lens from a ZMX file into the workspace. Display a 2-D visualization of the optical system using the view2d object function.

    opsys = zmximport("DoubleGaussLens.zmx");
    view2d(opsys);

    Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title 55-mm F/1.2 for 35-mm SLR (Handbook Of Optics Vol II, Ch 16, Fig 1).

    Remove the last component from the optical system using the remove object function. This removes the image plane from the optical system.

    remove(opsys)          

    Display a 2-D visualization of the optical system using the view2d object function.

    hv = view2d(opsys);

    Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title 55-mm F/1.2 for 35-mm SLR (Handbook Of Optics Vol II, Ch 16, Fig 1).

    Load a double Gauss lens from a ZMX file into the workspace. Display a 2-D visualization of the optical system using the view2d object function.

    opsys = zmximport("DoubleGaussLens.zmx");
    view2d(opsys,Labels="component");

    Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title 55-mm F/1.2 for 35-mm SLR (Handbook Of Optics Vol II, Ch 16, Fig 1).

    To remove a specific optical component from the system, use the remove function, and specify an index. The index specifies the position of the optical component to remove from the optical system. Remove the first doublet.

    remove(opsys,2)

    Display a 2-D visualization of the modified optical system using the view2d object function.

    view2d(opsys,Labels="component");

    Figure contains an object of type optics.ui.opticalsystemviewer2d. The chart of type optics.ui.opticalsystemviewer2d has title 55-mm F/1.2 for 35-mm SLR (Handbook Of Optics Vol II, Ch 16, Fig 1).

    Input Arguments

    collapse all

    Optical system, specified as an opticalSystem object.

    Component index, specified as a positive scalar. The index is the location of an optical component in the Components property of the opticalSystem object opsys. The order of the components in Components is with respect to the ray propagation along the optical axis, beginning with the light source.

    Version History

    Introduced in R2026a