Trouble graphing this non-linear function

I am lost on this question:
x= linspace (0,10,100)
y = (((factorial(x))^(1./x))/(x))
fplot (x,y)
xlim[0,100]

3 Commenti

How do I get the MATLAB graph to match the one on desomos?
Sam Chak
Sam Chak il 8 Mag 2022
Modificato: Sam Chak il 8 Mag 2022
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].
Yeah I somehow got it to work just by:
x = 1:100;
y = ((factorial(x)).^(1./x))./x
plot (x,y)

Accedi per commentare.

Risposte (1)

VBBV
VBBV il 8 Mag 2022
Modificato: VBBV il 8 Mag 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 Commenti

So how do I get the MATLAB graph to match the one on desomos?
You make the FREE online Graphing Calculator -- Desmos, looks very user-friendly.

Accedi per commentare.

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Tag

Richiesto:

il 8 Mag 2022

Commentato:

il 8 Mag 2022

Community Treasure Hunt

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

Start Hunting!

Translated by