how to use function as an input to other function ?
显示 更早的评论
in my code I want to make 1 function that stores all the values of my circuit and in the other function to run simulink simultaion , my questio is simple is there a wat to insert output of function in a new function as input of the function insted of writing those varibles ?
for exmaple this my 1 function
function [U,R,R1,Duty_Cycle,C,R_C,C1,R_C1,L1,R_L1,L2,R_L2,V_diode,f,T] =Simulink_values()
U=12;
R=100;
R1=0.1;
Duty_Cycle=50;
C=1000e-6;
R_C=eps;
C1=820e-6;
R_C1=eps;
L1=330e-6;
R_L1=eps;
L2=330e-6;
R_L2=eps;
V_diode=eps;
f=18e3;
T=1/f;
end
and in my second function to write like this :
[t,I_C1] = simulink_results(Simulink_values);
insted of wrting like this :
[t,I_C1] = simulink_results(U,R,R1,Duty_Cycle,C,R_C,C1,R_C1,L1,R_L1,L2,R_L2,V_diode,f,T);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!