Integration of functions of 1 and 2 vaiables

2 ビュー (過去 30 日間)
Ashok Das
Ashok Das 2021 年 6 月 30 日
編集済み: Amit Bhowmick 2021 年 7 月 1 日
I have two questions:
  1. I have a function like this: f(x) = 1 (if x=0) and f(x)=0 (if x~=0). How can I integrate between any interval (a,b)?
  2. Two-dimensional function: f(x,y) is given. How can I integrate f(x,y) with respect to only the variable 'x', while keeping 'y' fixed?

回答 (1 件)

Amit Bhowmick
Amit Bhowmick 2021 年 7 月 1 日
  1. You can use dirac function to define,
syms x
f=dirac(x)
intf=int(f,x) %Indefinite integration
intfd=int(f,x,[a b] %definite integration
2. For question 2 use this
syms x y
f=x^2+y^3
intf=int(f,x)
  4 件のコメント
Ashok Das
Ashok Das 2021 年 7 月 1 日
That's what I am asking for. If we have to use "integral", then we have to make the function in the form
fun = @(x,y) ________
However, in my case the function is of not this form.
Can you give an example for this?
Thank you.
Amit Bhowmick
Amit Bhowmick 2021 年 7 月 1 日
編集済み: Amit Bhowmick 2021 年 7 月 1 日
If you keep y fixed then it would be symbol only unless you provide some value of y. I think integral function does pure numerical integration (You can check reference page). hence it is not possible to integrate using integral where y is a symbol. So you can do one thing make an array of Y=a:b,
and put y=Y(ii) and then integrate using integral(f,ax,bx) where f=@(x) ax+by+c (say)
or use integral2(f,ax,bx,ay,by) f=@(x,y) ax+by+c

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by