Any ideas?
perhaps I need to print the real and then the imginary in two parts:
fprintf('%1.4g %1.4g \n', real(z), imag(z))
but is there a way to avoid this?
Thanks.
Not that I know of. I would probably do this though.
fprintf('%5.4g + j%5.4g\n', real(z), imag(z))
Murphy
> Not that I know of. I would probably do this though.
>
> fprintf('%5.4g + j%5.4g\n', real(z), imag(z))
If z is a vector, do this:
fprintf('%5.4g + j%5.4g\n', [real(z) imag(z)].');
Dan
Hi,
You can use 'disp' function instead of 'fprintf'.
'disp' display a complex number, but 'fprintf' show only the real
part.