Trouble graphing this non-linear function

2 views (last 30 days)
Alex Chen
Alex Chen on 8 May 2022
Commented: Alex Chen on 8 May 2022
I am lost on this question:
x= linspace (0,10,100)
y = (((factorial(x))^(1./x))/(x))
fplot (x,y)
xlim[0,100]
  3 Comments
Alex Chen
Alex Chen on 8 May 2022
Yeah I somehow got it to work just by:
x = 1:100;
y = ((factorial(x)).^(1./x))./x
plot (x,y)

Sign in to comment.

Answers (1)

VBBV
VBBV on 8 May 2022
Edited: VBBV on 8 May 2022
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 Comments

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by