0
Fast

Convert complex numbers from mp to sym

Michael_ 9 år siden opdateret af Pavel Holoborodko 9 år siden 2
Hello again.

The following statement leads to an error:
x = mp('1i');
xvpa = mp2sym(x);

I think the reason is the following:
xvpa = vpa('1*i')  (This works)
xvpa = vpa('1i')   (Without "*" it gives an error)
Under vurdering
The '1i' syntax is standard in MATLAB. It is strange that 'vpa' doesn't support it.

Please modify the mp2sym script as follow:

    r = sym(zeros(size(s)));
    for n=1:numel(s), r(n) = sym(strrep(num2str(s(n)),'i','*i')); end;

Kundesupport af UserEcho