Trouble graphing this non-linear function

조회 수: 1 (최근 30일)
Alex Chen
Alex Chen 2022년 5월 8일
댓글: Alex Chen 2022년 5월 8일
I am lost on this question:
x= linspace (0,10,100)
y = (((factorial(x))^(1./x))/(x))
fplot (x,y)
xlim[0,100]
  댓글 수: 3
Sam Chak
Sam Chak 2022년 5월 8일
편집: Sam Chak 2022년 5월 8일
I'm also wondering how to plot the discrete math factorials in MATLAB, for example , since x must be real non-negative integers. By default, fplot(f) can plot a function f over the x interval [-5 5].
Alex Chen
Alex Chen 2022년 5월 8일
Yeah I somehow got it to work just by:
x = 1:100;
y = ((factorial(x)).^(1./x))./x
plot (x,y)

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

답변 (1개)

VBBV
VBBV 2022년 5월 8일
편집: VBBV 2022년 5월 8일
x = 1:100;
y = ((factorial(x)).^(1./x))./x; % use element wise division
fplot(y,[0 100]) % no space between function and parenthesis
xlim([0,100]) % use() for xlim
  댓글 수: 3
Sam Chak
Sam Chak 2022년 5월 8일
You make the FREE online Graphing Calculator -- Desmos, looks very user-friendly.
VBBV
VBBV 2022년 5월 8일
plot(x,y)

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

카테고리

Help CenterFile Exchange에서 Directed Graphs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by