Matlab using mesh to plot (Error using mesh (line 76) X, Y, Z, and C cannot be complex) -


i'm trying plot function keep getting 'error using mesh (line 76) x, y, z, , c cannot complex'. found question suggested use of abs on sqrt function not give desired output. output given should thisenter image description here

function [ x,y,z] = plotcomplexfunction(  ) %untitled summary of function goes here %   detailed explanation goes here    x = linspace(-1,1);   y = linspace(-2*pi,2*pi);     [x,y] = meshgrid(x,y);    = sqrt(-1);    z = exp(x+(i*y));    mesh(x,y,z) end 

it looks plot made using real part of z. changing line call mesh to:

mesh(x,y,real(z)); 

produces plot:

mesh plot of real part of z


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -