MATLAB Answers

start simulink via power_analyze using variables from another workspace

조회 수: 1(최근 30일)
Rostislav Teryaev
Rostislav Teryaev 2 Apr 2019
When I want to run a simulation within a matlab function I use
clear
clc
myFunc()
function myFunc()
R = 5;
options = simset('SrcWorkspace','current');
sim('modelName.slx', [], options); % This model has a block with parameter R
end
If I don't use
options = simset('SrcWorkspace','current');
MatLab can't find variable R, because it looks for in not in a function workspace, but in workspace of the main script.
Now, I need to calculate not a transient, but steady state solution, thus I use
power_analyze('modelName')
However, It doesn't allow me to pass "option" parameter into it to use 'power_analyze" within a function.
Is there any way to do something with it?

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(0개)

범주

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by