0
Corrigé

Convert complex numbers from mp to sym

Michael_ il y a 10 ans mis à jour par Pavel Holoborodko il y a 10 ans 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)
À l'étude
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;