function s = char(c)

%@komplex/char - prevod objektu 'komplex' na retezec
%s = char(c);


if (c.real == 0 && c.imag == 0)
    s = '0';
elseif (c.real == 0)
    s = [num2str(c.imag) 'i'];  % -3i
elseif (c.imag==0)
    s = num2str(c.real);        %5
else
    s = [num2str(c.real) sprintf('%+g',c.imag) 'i'];     %vysledek je napr: 5-3i
end
