メインコンテンツ

removeCustomTerrain

Remove custom terrain data

Since R2021a

Description

removeCustomTerrain(terrainName) removes the custom terrain data specified by the user-defined terrainName. You can use this function to remove terrain data that is no longer needed. The terrain data to be removed must have been previously added using addCustomTerrain.

example

Examples

collapse all

This example shows how to add and remove custom terrain data from a UAV scenario.

Add Custom Terrain Data

Add terrain for a region in Boulder, CO. The DTED file was downloaded from the "SRTM Void Filled" data set available from the U.S. Geological Survey.

dtedfile = "n39_w106_3arc_v2.dt1";
addCustomTerrain("CustomTerrainBoulder",dtedfile)

Create a UAV scenario with the origin set at Boulder, CO. Then, add a terrain mesh.

scenario = uavScenario(ReferenceLocation=[39.5 -105.5 0]);
addMesh(scenario,"terrain",{"CustomTerrainBoulder",[-200 200],[-200 200]},[0.8500 0.3250 0.0980])

Show the scenario.

show3D(scenario);

Figure contains an axes object. The axes object with xlabel East (m), ylabel North (m) contains an object of type patch.

Remove Custom Terrain Data

Use removeCustomTerrain to remove the custom terrain data.

removeCustomTerrain("CustomTerrainBoulder")

Input Arguments

collapse all

User-defined identifier for terrain data previously added using addCustomTerrain, specified as a string scalar or a character vector.

Data Types: char | string

Version History

Introduced in R2021a