Create script function VDC

2 次查看(过去 30 天)
v = input('Digite el voltaje: ');
T = input ('Digite el Tiempo: ');
f = @(V) v;
int_inf = input('Ingrese intervalo inferior: ');
int_sup = input('Ingrese intervalo inferior: ');
VDC = (1/T(integral(f,int_inf,int_sup)));
when I run this code I get the following mistakes
please Help!!

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-9-15
Is v constant? In that case, you don't need to call integral(). You can just use VDC=v*(int_sup-int_inf). However, you can fix the error in the current code by replacing the line with
VDC = (1/T*(integral(f,int_inf,int_sup, 'ArrayValued', 1)))

类别

Help CenterFile Exchange 中查找有关 Instrument Control Toolbox 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by