'Input argumenents must be 'double' error in bold

R=1000;
C=47e-09;
F=500;
T=1/F;
A=5;
%Equation of Time Constant
Time_Const = R*C;
%Equation of Vin
syms x
Vin=A/2*square(2*pi*F*x)+A/2;
%Equation of Vout
Vout=(1/Time_Const)*int(Vin,0,Time_Const);
disp('The RC time constant is')
disp(Time_Const)
disp('The Vout is')
disp(Vout)
I have this code that I am unable to run. It prompts 'input arguments must be double'. I have looked through my code and workspace but can't seem to find any issue. Could someone help me out? Thanks!
Sorry! Is this line instead.

2 commentaires

Adam
Adam le 4 Mar 2019
What is the type of Vin? I don't use the symbolic toolbox so I have no idea what types it ends up with, but Vin is based on x which is declared as syms.
madhan ravi
madhan ravi le 4 Mar 2019
Modifié(e) : madhan ravi le 4 Mar 2019
If you don‘t respond to any of the comments/answers you are the one who suffers.

Connectez-vous pour commenter.

Réponses (1)

madhan ravi
madhan ravi le 4 Mar 2019
Modifié(e) : madhan ravi le 4 Mar 2019
Remove syms x
Vin=@(x)...
% change int to integral

Community Treasure Hunt

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

Start Hunting!

Translated by