Matlab Error "X, Y, Z, and C cannot be complex"
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikolas Spiliopoulos
le 15 Juil 2020
Réponse apportée : Walter Roberson
le 15 Juil 2020
Hi all,
I am trying to plot a surface however, I get an error "X, Y, Z, and C cannot be complex." which means, apparently there are some xomplex values. However, I put the command to get only the real values and I get a blank graph with no points at all (it is obvious that there are solutions with real values). Couod you help me with that? here is the code
a=0.1735;
b=0.19;
c=0.3283;
d=-0.017;
[I,I_opt] = meshgrid(0.1:0.1:4.67,0.1:0.1:4.67);
Z=exp(0.3524*(I-I_opt))*a*exp(b*I)*(1-a*exp(b*I))/(c*I_opt^d*(1-c*I_opt^d));
redChannel=Z<1;
colors = double(redChannel);
surf(I,I_opt,real(Z),colors)
zlim([0 10])
0 commentaires
Réponse acceptée
Walter Roberson
le 15 Juil 2020
>> Z=exp(0.3524.*(I-I_opt)).*a.*exp(b.*I).*(1-a.*exp(b.*I))./(c.*I_opt.^d.*(1-c.*I_opt.^d));
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surface and Mesh Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!