I want to draw graph between "P" and "x" but it is throwing the following error.
Afficher commentaires plus anciens
syms x
alpha = -0.1;
sigma = 0.1;
eps = -0.1;
lambda = 2;
M = 4;
psi = 0.1;
a = 2;
figure
A = eps + alpha^3 + (3 * sigma^2 * alpha);
B = alpha^2 + sigma^2;
hbar = @(x) a - a.*x + x;
a1 = @(x) tanh(M .* hbar(x));
b1 = @(x) 1 - (tanh(M .* hbar(x))).^2;
c1 = (M * alpha) - ((M^3 * A)/3);
d1 = @(x) (hbar(x) .* a1(x)) + (hbar(x) .* b1(x) .* c1) + (alpha * a1(x)) + (M * B .* b1(x));
e1 = @(x) ((hbar(x).^3) .* a1(x)) + ((hbar(x).^3) .* (1 - a1(x)) .* c1) + (A *a1(x)) + (3 .* (hbar(x).^2) .*alpha .* a1(x)) + (3 .* (hbar(x).^2) .* M * B) - (3 .* (hbar(x).^2) .* M * B .* a1(x)) + (3 .* hbar(x) .*B .* a1(x)) + (3 .* hbar(x) .* b1(x) .* M * A );
f1 = 2 * (M^2) * (1 + lambda);
g1 = @(x) (3 * lambda * d1(x)) + (f1 * e1(x)) - (3 *lambda *M * B);
g2 = @(x) f1 * (a1(x) + b1(x) .* c1);
G = @(x) (1/ (2 + lambda)) .* g1(x) .* (1./g2(x));
j1 = psi/(1 + lambda);
i1 = @(x) 0.5 .* hbar(x) .* (G(x) + j1).^(-1);
I1 = @(x) integral(i1,0,x);
i2 = @(x) (G(x) + j1) .^(-1);
I2 = @(x) integral(i2,0,x);
I3 = integral(i1,0,1);
I4 = integral(i2,0,1);
D = I3 / I4;
P = @(x) I1(x) + (D * I2(x));
ylim([0 0.5])
xlim([0 1])
fplot(P(x), [1 6])
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

