'DC Voltage Source' Block Parameter Name Error
显示 更早的评论
I'm trying to run a simple script to place a Simscape block, but an error has occurred.
What is the parameter name for the DC Voltage Source block?
block direction :
Simscape - Foundation Library - Electrical - Electrical Sources - DC Voltage Source
---------- My script ----------
clc;
% Create a new Simulink model
modelName = 'mySimscapeModel';
open_system(new_system(modelName));
% Load the DC Voltage Source block
blockPath = 'fl_lib/Electrical/Electrical Sources/DC Voltage Source';
add_block(blockPath, [modelName, '/DC Voltage Source 1']);
% Optionally, set parameters for the DC Voltage Source
set_param([modelName, '/DC Voltage Source 1'], 'Constant voltage', '5'); % Set output voltage to 5V
---------- Error ----------
Error using BDC_FET_test (line 12)
DC Voltage Source block (mask) does not have a parameter named 'Constant voltage'
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Electrical Sensors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
