'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 Comments

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.
If you don‘t respond to any of the comments/answers you are the one who suffers.

Sign in to comment.

Answers (1)

Remove syms x
Vin=@(x)...
% change int to integral

Asked:

on 4 Mar 2019

Edited:

on 4 Mar 2019

Community Treasure Hunt

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

Start Hunting!