function dy = f(x,y); % I want to compute the ODE dy/dx = f(x,y) = cos(x)*y dy = cos(x)*y; % For the pendulum, I have theta'' + sin(theta) = 0. % % theta' = v % v' = - sin(theta) % % where theta = y(1) and v = y(2). I need dy to be a column vector. % % dy(1,:) = y(2); % dy(2,:) = -sin(y(1));