Matlab Problem: Integrating & Multiplying Functions w/o File

  • Context: MATLAB 
  • Thread starter Thread starter oby7842
  • Start date Start date
  • Tags Tags
    Function Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
oby7842
Messages
9
Reaction score
0
hellow everyone, its my first post. In my problem i have a function f=f(x)... inned to integrate it from 0 to a ...I need to multiply f with some other function g(x) and differentiate it...i don't want to use another function file...i tried inline function command but it can't multiply with g(x) and integrate it...

I need some suggestion badly. Thanks

omar Bin Yusuf
 
Physics news on Phys.org
For symbolic integration and differentiation look into the functions 'int' and 'diff'.

To do this numerically, look into 'trapz' or 'quad' to integrate. Numerical differentiation is simply:

[tex]\frac{\Delta x}{\Delta y} = \frac{x_{i+1} - x_{i}}{y_{i+1} - y{i}}<br /> <br /> [/tex]
 
oby7842 said:
i don't want to use another function file

Any specific reasons for this ? there is a reason MATLAB asks for separate file for better integration techniques and besides it makes job easier and cleaner.

Regards.