How can I integral with some data?
1 view (last 30 days)
Show older comments
Hello. I desperately need your help
I have data of some wave data ('I named data, 1x1802')
I was trying to do with ode23 , quad,and int all of these doesn't work
% Per.m
% This program will use the function dfunc3_12.m, they should
% be in the same folder
tspan = [0: 0.01: 18.01];
i = [1: 1: 1801];
x0 = [0; 0];
[t,x] = ode23('PPP', tspan, x0); disp(' t x(t) xd(t)'); disp([t x]); plot(t,x(:,1)); xlabel('t'); gtext('x(t)'); title('PPP');
% PPP.m
function f = PPP (~,x)
f = zeros(2,1);
f(1) = x(2);
f(2) = -data - (2*pi*0.1)*x(1);
and Command Window just keep showing this
Error in ==> PPP at 4 f(1) = x(2);
??? Error using ==> feval Undefined function or method 'PPP' for input arguments of type 'double'.
Error in ==> odearguments at 110 f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode23 at 172 [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in ==> Per at 7 [t,x] = ode23('PPP', tspan, x0);
I cannot fix the problem
If you got any answer (with quad ,int or whatever )I will really appreciate it
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!