![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564116/image.jpeg)
What am I doing wrong here? I am trying to recreate following highlighted equations in the table.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nissal Arachchige
le 26 Mar 2021
Commenté : Paul Hoffrichter
le 28 Mar 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564051/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564061/image.jpeg)
ep = linspace(0,1);
m1 = 1.5; m2 = 3.8;
ep0= 1; alpha = 0.785; epp = 0.11;
qep = (2.76*ep*cosh((3*ep)-1.92));
I1 = ep.^ m1;
I2 = ep.^ m2;
I3 = ep*((ep-epp)/(ep0-epp)).^alpha;
I6 = 1-(qep*((3*(1-ep))/(3-ep)));
Hold on
plot(ep,I1)
plot(ep,I2)
plot(ep,I3)
plot(ep,I6)
Hold off
0 commentaires
Réponse acceptée
Paul Hoffrichter
le 27 Mar 2021
Modifié(e) : Paul Hoffrichter
le 27 Mar 2021
clc; clear; clf
ep = linspace(0,1);
m1 = 1.5; m2 = 3.8;
ep0= 1; alpha = 0.785; epp = 0.11;
qep = (2.76*ep.*cosh((3*ep)-1.92));
I1 = ep.^ m1;
I2 = ep.^ m2;
zz = (ep-epp)/(ep0-epp);
zza = zz .^ alpha; % zza is complex
I3 = ep .* zza;
I6 = 1-(qep*((3*(1-ep))/(3-ep)));
hold on
plot(ep,I1);
plot(ep,I2)
plot(ep,I3) % This is Line 18 - usually do not plot a complex vector like this
plot(ep,I6)
hold off
warning:
Warning: Imaginary parts of complex X and/or Y arguments ignored.
> In Untitled (line 18)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/564116/image.jpeg)
4 commentaires
Paul Hoffrichter
le 28 Mar 2021
I was a surprised at first about the complex numbers. But then I thought about what if alpha was 0.5 instead of 0.785. Then if x is a negative number, we have a purely imaginary result for x^(.5)=sqrt(x)= sqrt{(-1) * abs(x)} = 0 + j*sqrt(abs(x)). For other values of alpha between (0.5, 1.0), we get complex numbers.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/565616/image.jpeg)
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!