How do I fix "Error using ==> mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use the VPA function instead." ?

6 ビュー (過去 30 日間)
This is my script and the error I get after I enter the series equation and starting k:
syms k
series_eq = input('Enter equation(k = index): ');
a = input('Enter starting k (integer >= 1): ');
disp(' ')
p = limit(series_eq(k),k,inf,'left')
p = double(p);
fseries_eq = matlabFunction(series_eq);
k = a:(a + 999);
if abs(fseries_eq(k)) >= abs(fseries_eq(k + 1))
if p == 0
disp('The series equation:')
series_eq
disp('Is convergent.')
disp(' ')
else
disp('The series equation:')
series_eq
disp('Is divergent.')
disp(' ')
end
else
if p == 0
disp('The series equation:')
series_eq
disp('May converge or diverge.')
disp(' ')
else
disp('The series equation:')
series_eq
disp('Is divergent.')
end
end
??? Error using ==> mupadmex
Error in MuPAD command: DOUBLE cannot convert the input expression into a
double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> sym.sym>sym.double at 936 Xstr = mupadmex('symobj::double', S.s, 0);
Error in ==> sym.sym>privformatscalar at 2678 x = double(x);
Error in ==> sym.sym>privformat at 2663 s = privformatscalar(x);
Error in ==> sym.sym>sym.subsref at 1379 [inds{k},refs{k}] = privformat(inds{k});
Error in ==> altlimit at 5 p = limit(series_eq(k),k,inf,'left')

採用された回答

David Cazenave
David Cazenave 2022 年 5 月 2 日
It's because your trying to convert a symbolic variable into a double precision number.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by