35 lines
799 B
Matlab
35 lines
799 B
Matlab
|
|
% 创建三个 Simulink.BusElement 对象
|
|
pwr_voltage = Simulink.BusElement;
|
|
pwr_voltage.Name = 'pwr_voltage';
|
|
|
|
bat_voltage = Simulink.BusElement;
|
|
bat_voltage.Name = 'bat_voltage';
|
|
|
|
buck_in_voltage = Simulink.BusElement;
|
|
buck_in_voltage.Name = 'buck_in_voltage';
|
|
|
|
buck_out_voltage = Simulink.BusElement;
|
|
buck_out_voltage.Name = 'buck_out_voltage';
|
|
|
|
bat_current = Simulink.BusElement;
|
|
bat_current.Name = 'bat_current';
|
|
|
|
temperature = Simulink.BusElement;
|
|
temperature.Name = 'temperature';
|
|
|
|
|
|
bat_sv = Simulink.BusElement;
|
|
bat_sv.Name = 'bat_sv';
|
|
bat_sv.Dimensions = 24;
|
|
|
|
% 创建 Simulink.Bus 对象,并添加 '' 字段
|
|
InBus = Simulink.Bus;
|
|
InBus.Elements = [pwr_voltage bat_voltage buck_in_voltage buck_out_voltage bat_current temperature bat_sv];
|
|
|
|
|
|
|
|
|
|
|
|
|