Main Content

modifyModuleAssembly

Modify properties of module assemblies

Since R2023b

Description

example

updatedBattery = modifyModuleAssembly(battery,Name=Value) modifies one or more properties of the underlying ModuleAssembly objects inside the battery object battery by using one or more name-value arguments. To modify the properties of a single ModuleAssembly object, specify the Index argument. To modify the properties of all the ModuleAssembly objects, do not specify the Index argument.

Examples

collapse all

This example shows how to quickly modify the gap between modules in all module assemblies inside a battery pack by using the modifyModuleAssembly function.

Create a Pack object and display the intermodule gap of a module assembly that constitutes this battery pack.

battery = batteryPack;
disp(battery.ModuleAssembly(1).InterModuleGap)
  1.0000e-03 : m

Change the InterModuleGap property value of all module assemblies inside battery to 0.005 and display the updated value.

updatedbattery = modifyModuleAssembly(battery,InterModuleGap=0.005);
disp(updatedbattery.ModuleAssembly(1).InterModuleGap)
  0.0050 : m

This example shows how to quickly modify the gap between modules inside the second module assembly of a battery pack by using the modifyModuleAssembly function.

Create a Pack object that comprises two identical ModuleAssembly objects. Each ModuleAssembly object comprises six identical Module objects.

module = batteryModule;
moduleassembly = batteryModuleAssembly(repmat(module,6,1));
battery = batteryPack(repmat(moduleassembly,2,1));

Display the value of the gap between modules inside the second module assembly.

disp(battery.ModuleAssembly(2).InterModuleGap)
   1.0000e-03 : m

Change the InterModuleGap property value of the second module assembly inside battery to 0.005 and display the updated value.

updatedbattery = modifyModuleAssembly(battery,Index=2,InterModuleGap=0.005)
disp(updatedbattery.ModuleAssembly(2).InterModuleGap)
      0.0050 : m

Input Arguments

collapse all

Battery pack that contains the ModuleAssembly object that you want to modify, specified as a Pack object.

Example: modifyModuleAssembly(Pack,InterModuleGap=0.005) sets the InterModuleGap property value of all the underlying ModuleAssembly objects inside the Pack object to 0.005 m.

Name-Value Arguments

Specify pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: modifyModuleAssembly(Pack,InterModuleGap=0.005)

Index of the underlying ModuleAssembly object that you want to modify inside the parent battery object battery, specified as a positive integer.

If you do not specify this argument, the modifyModule function modifies the specified properties of all underlying module assemblies inside the battery object battery.

You can use the modifyModuleAssembly function to modify all properties of the ModuleAssembly object inside the parent battery object battery using name-value arguments. For a list of all supported name-value arguments, see the Properties section of the ModuleAssembly object.

Output Arguments

collapse all

Battery pack with modified module assemblies, returned as a Pack object.

Version History

Introduced in R2023b