Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type = '';
- xn = 0:2*pi;
- while type ~= "symbolic" && type ~= "numeric"
- type = lower(input("Symbolic or Numeric Integration?\n", 's'));
- end
- syms x
- form = cos(x)*(sin(x))^3;
- y = cos(xn).*(sin(xn)).^3;
- switch type
- case 'symbolic'
- F = int(form);
- disp(F);
- case 'numeric'
- F = int(form);
- Fvpa = vpa(F);
- disp(Fvpa);
- end
- figure(3)
- hold on
- plot(xn, y);
- fplot(F, [0 2*pi]);
- legend('f(x)','Integral of f(x)')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement