modifyModule
Description
modifies one or more properties of the underlying updatedBattery
= modifyModule(battery
,Name=Value
)Module
objects inside the
battery object battery
by using one or more name-value arguments. To
modify the properties of a single Module
object, specify the
Index
argument. To modify the properties of all the
Module
objects, do not specify the Index
argument.
Examples
Modify Number of Series-Connected Parallel Assemblies Inside Pack
This example shows how to quickly modify the number of
series-connected parallel assemblies inside a battery pack by using the
modifyModule
function.
Create a Pack
object and display the number of series-connected
parallel assemblies.
battery = batteryPack; disp(battery.ModuleAssembly(1).Module(1).NumSeriesAssemblies)
1
Change this value to 100 series-connected parallel assemblies and display the updated value.
updatedbattery = modifyModule(battery,NumSeriesAssemblies=100); disp(updatedbattery.ModuleAssembly(1).Module(1).NumSeriesAssemblies)
100
Modify Number of Series-Connected Parallel Assemblies Inside Specific Module of Pack
This example shows how to quickly modify the number of
series-connected parallel assemblies inside the fifth module of the second module assembly
of a battery pack by using the modifyModule
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 number of series-connected parallel assemblies of the fifth module inside the second module assembly.
disp(battery.ModuleAssembly(2).Module(5).NumSeriesAssemblies)
1
Change this value to 100 series-connected parallel assemblies and display the updated value.
updatedbattery = modifyModule(battery,Index=[2,5],S=100) disp(updatedbattery.ModuleAssembly(2).Module(5).NumSeriesAssemblies)
100
Input Arguments
battery
— Parent battery object to modify
ModuleAssembly
object | Pack
object
Parent battery object of the Module
object that you want to modify,
specified as a ModuleAssembly
or Pack
object.
Example: modifyModule(Pack,InterParallelAssemblyGap=0.005)
sets
the value of the InterParallelAssemblyGap
property of all the
underlying Module
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:
modifyModule(Pack,InterParallelAssemblyGap=0.005)
Index
— Index of underlying object to modify
positive integer | two-element vector of positive integers
Index of the underlying Module
object that you want to modify
inside the parent battery object battery
, specified as one of
these values:
A positive integer if
battery
is aModuleAssembly
object.A two-element vector of positive integers if
battery
is aPack
object. The first and second elements of this vector define the first and second indices of the module assembly and module, respectively, that you want to modify.
If you do not specify this argument, the modifyModule
function modifies the specified properties of all underlying modules inside the
battery object battery
.
You can use the modifyModule
function to modify all properties of
the Module
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
Module
object.
Output Arguments
updatedBattery
— Parent battery object with modified modules
ModuleAssembly
object | Pack
object
Parent battery object with modified modules, returned as a
ModuleAssembly
or Pack
object.
Version History
Introduced in R2023b
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)