yes i is imaginaryunit

# plotting lines

2 views (last 30 days)

Show older comments

### Answers (3)

Mohsen Davarynejad
on 11 Dec 2011

y = [0:.1:10]

plot(5,y)

xlabel('Re')

ylabel('Im')

##### 3 Comments

Walter Roberson
on 12 Dec 2011

Walter Roberson
on 11 Dec 2011

y = 0:10;

x = 5 * ones(size(y));

z = x + i * y;

Now, if "i" were a real-valued constant, you would then use

plot3(x, y, z)

However, "i" is the complex constant, so you have a line in complex space, and there is no way to draw that in one step. Instead you would need to use something like,

plot3(x, y, real(z), 'r', x, y, imag(z), 'g', x, y, abs(z), 'b')

or perhaps plot 3 separate images using subplot()

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!