my problem e ^x= ∑n=0 ∞ * x ^n\ n ! but this program didn't work . it gives infinity error and I don't know how to use it. invalid range and called from errors
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
function [S] = yanital(x,y)
T=0;
for n=0:inf
nf=1;
for i=1:n
nf=nf*i;
T=T(x^n/nf)
S=T;
endfor
endfor
endfunction
0 Kommentare
Akzeptierte Antwort
KSSV
am 1 Jun. 2020
n = 20 ; % can be changed
x = pi ; % value of x
y = 0 ; % intilaize the required value
for i = 0:n
y = y+x^i/factorial(i) ;
end
[exp(x) y]
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!