Hi,I'm very new to matlab so this might be a dumb question but,I'm trying to solve a first order differential equation with a dubble sin,but everytime I add a sin to the y matlab gives a "Invalid expression" error.Does anyone know how to solve this problem?h = 0.01;begin = 0.0;end = 5;x = begin:h:end;y = zeros(size(x));y(1) = 2;for i=1:numel(y)-1 f = sin(y(i).)*sin(x(i).^2) y(i+1) = y(i) + h .* f;endplot(x,y);grid on;
MATLAB: Dubble sin in first order Differential Equation
differential equations
Best Answer