ploting Mitagg leffler function

Hello h
How can I plote the Mittage leffler for the function in [0,50], Here is the code but I do not know how to define the function.
I appreciate your help.
alpha=0.5;
beta=1.2;
function E= ML(z,alpha,beta)
plot(E)
end

Réponses (3)

Follow this approach. Let's say you'd need to plot: f(a, b, t) = a*exp(cos(b*t)) using a nested function.
a = 2.13;
b = 3.5;
t = linspace(-10, 10, 500);
OUTPUT=My_Fun(a, b, t);
function F = My_Fun(a, b, t)
F = a*exp(cos(b*t));
plot(t, F)
end

5 commentaires

Thank you for help. But in the follwing code there is an error (Unrecognized function or variable 'E') , and I do not know how to fix it
alpha=0.2;
beta=0.3;
t = linspace(0, 1, 50);
z=-sqrt(t);
function E= ML(z,alpha,beta)
plot(E,t)
end
Torsten
Torsten le 10 Sep 2023
Modifié(e) : Torsten le 10 Sep 2023
Yes, MATLAB's question is justified: You say you want to return "E" from your function "ML":
function E= ML(z,alpha,beta)
but you don't define it therein. You only write a senseless plot command:
plot(E,t)
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 10 Sep 2023
What Torsten indicated is that you should define what is the formulation of E.
eg.,: E = alpha+beta*z
E is sum_{k=0}^{infty} z^k/Gamma(alpha*k+beta) and I wrote it as
syms k z alpha beta
E=symsum(z^k/gamma(alpha*k+beta),k,0,Inf)
but still not working
alpha = sym(0.5);
beta = sym(1.2);
syms k z
E(z) = symsum(z^k/gamma(alpha*k+beta),k,0,Inf)
E(z) = 
t = linspace(-10, 10, 50).';
Y = E(sqrt(sym(t)))
Y = 
y = double(Y);
subplot(2,1,1); plot(t, real(y), 'k-.'); title('real part');
subplot(2,1,2); plot(t, imag(y), 'r:.'); title('imag part')

Connectez-vous pour commenter.

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 10 Sep 2023
As shown in one of the matlab exchange, edit this below shown function file using your own input variables, viz. k, z, alpha, beta
a = ?;
b = ?;
c = ?;
x = ?;
OUTPUT=ML_fun(a, b, c, x);
function f=ML_fun(a,b,c,x)
gamma_c=1.0/gamma(c);
f=0; fa=1; j=0;
while norm(fa,1)>=eps
fa=(gamma(c+j)*gamma_c)/gamma(j+1)/gamma(a*j+b) *x.^j;
f=f+fa; j=j+1;
% You can also add: plot(), hold on % see the simulation progress of ML
% fcn
end
% Or here: plot()
end

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by