# How can we plot a function with domain involving infinity

조회 수: 106(최근 30일)
zahid 2017년 4월 19일
답변: Jayesh Shimpi 2019년 10월 5일
How can we plot a function with the domain involving infinity? Suppose I want to plot the following function:
f(y)=(2*pi*y)^(-1/2)*exp(-y/2); y>0
How can I do this in MATLAB?
Thanks
##### 댓글 수: 1표시숨기기 없음
Use the tick property in Matlab plot as discribed below

댓글을 달려면 로그인하십시오.

### 채택된 답변

Andrew Newell 2017년 4월 19일
Of course, you can't plot the whole thing, but you can plot enough so that it's obvious where the curve is going. One approach is to let MATLAB choose the domain for you:
f = @(y) (2*pi*y).^(-1/2).*exp(-y/2);
ezplot(f)

댓글을 달려면 로그인하십시오.

### 추가 답변(1개)

Jayesh Shimpi 2019년 10월 5일
Infinity symbol used in Matlab for limit to plot the graph

댓글을 달려면 로그인하십시오.

### 범주

Find more on Line Plots in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by