Contenuto principale

Create and Install MOSFET Part Collection

Since R2026a

This example shows how to create and install a part collection from a parameterized MOSFET (Ideal, Switching) block. Creating a part collection allows you to reuse sets of parameter values in future designs or share them with others. This example is step three in a series of examples that take you through parameterizing a MOSFET (Ideal, Switching) block and creating a part collection.

Parts contain block parameter data and metadata. When you author a part collection, you store parameter data in a BlockDataSet object and convert each BlockDataSet object to a JSON part file. You can create a new collection or use an existing collection to store each part. When you build the collection, Simscape™ generates an MLDATX file that you can share. After you install the collection, you can access the parts from the Block Parameterization Manager tool.

Create Empty Collection

Start by creating an empty collection. Give your collection a name and an organization ID to create unique identifiers for your collection.

collectionName = "myCollection";
organizationId = "myOrganization"; 

Create a new folder and instantiate a new empty collection with a unique ID in the format <organizationId>.<collectionName>.

if ~isfolder(collectionName)
    partrepo.collection.new(collectionName,organizationId);
end

Create Data Set

Create a data set in the empty collection. Import the parameter data from ParameterizedMOSFET model.

model = "ParameterizedMOSFET";
blockPath = strcat(model,"/","MOSFET");
load_system(model);

dataSetsFolder = fullfile(collectionName,"Datasets");
DataSet1 = partrepo.simscape.dataSetFromBlock(blockPath); % Import the parameterized block parameters
DataSet1.Metadata.Manufacturer = "Wolfspeed";
DataSet1.Metadata.PartNumber = "C3M0015065D-DataSheet";

Add optional metadata from the manufacturer data sheet [1] to help you quickly identify and compare parts in the Block Parameterization Manager.

DataSet1.Metadata.ParameterizationNote = "This part is parameterized from data sheet.";
DataSet1.Metadata.DatePartAdded = string(datetime("today"));
DataSet1.Metadata.PartSeries = "C3M™ MOSFET Technology";
DataSet1.Metadata.PartType = "MOSFET";
DataSet1.Metadata.Material = "Silicon Carbide";
DataSet1.Metadata.IdsMaxDC = simscape.Value(120,"A");
DataSet1.Metadata.IdsMaxPulsed = simscape.Value(418,"A");
DataSet1.Metadata.RgTurnOffLoss = simscape.Value(5,"Ohm");
DataSet1.Metadata.RgTurnOnLoss = simscape.Value(5,"Ohm");
DataSet1.Metadata.TjunctionMax = simscape.Value(175,"degC");
DataSet1.Metadata.TjunctionMin = simscape.Value(-40,"degC");
DataSet1.Metadata.VdsMax = simscape.Value(650,"V");
DataSet1.Metadata.VgsForDiodeCurrent = simscape.Value(-4,"V");
DataSet1.Metadata.VgsMaxTurnOn = simscape.Value(19,"V");
DataSet1.Metadata.VgsMinTurnOff = simscape.Value(-8,"V");
DataSet1.Metadata.VgsRefIdsAndTurnOnLoss = simscape.Value(15,"V");
DataSet1.Metadata.VgsRefTurnOffLoss = simscape.Value(-4,"V");

In this example, the part collection contains a single parameterized part. To add more parts, repeat the data set creation process. Once you have prepared all the data sets, pass them as a list along with their corresponding file names to the partrepo.exportDataSetsToJSON function. This function generates individual JSON files for each data set inside the part collection repository.

filename = fullfile(dataSetsFolder,DataSet1.Metadata.PartNumber);
partrepo.exportDataSetsToJSON(DataSet1,filename)

Export Collection as Shareable MLDATX File

Export the collection an as an MLDATX file. You can share this file with others.

partrepo.collection.build(collectionName)

Install Collection

Install the collection to add custom parts for the MOSFET (Ideal, Switching) block to the Block Parameterization Manager. To install the part collection, double-click the MLDATX collection file or run this command at the MATLAB® Command Window.

mldatxFilePath = fullfile(collectionName, "Build", collectionName + "_1.0.0.mldatx");
partrepo.collection.install(mldatxFilePath)

To open the Block Parameterization Manager, click the Select part button in the block dialog box. The MOSFET (Ideal, Switching) block supports a built-in part collection, so this button is always visible. You can enable this button in blocks that do not support built-in parts by installing a part collection that contains custom parts for that block. For a list of blocks in the Simscape™ Electrical™ libraries that support built-in parts, see Simscape Electrical Part Collection.

This screenshot shows the installed part collection along with the built-in parts. The Part number value of the new custom part is C3M0015065D-DataSheet. To reuse these parameter values, select the with that Part number. Then, in the toolstrip, click Apply all. Close the Block Parameterization Manager window.

Uninstall Collection

To uninstall the part collection, run this command at the MATLAB Command Window.

collectionId = organizationId + "." + collectionName;
partrepo.collection.uninstall(collectionId)
rmdir(collectionName,'s')

For more information about creating and sharing part collections, see Programmatically Manage Simscape Block Parameter Data.

Reference

[1] : “C3M0015065D, 650 V, 15 mΩ, Discrete SiC MOSFET | Wolfspeed.” Accessed November 20, 2025. https://www.wolfspeed.com/products/power/sic-mosfets/650v-silicon-carbide-mosfets/c3m0015065d/.

See Also

Tools

Simscape Blocks

Topics