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." ?

조회 수: 2(최근 30일)
David Cazenave 2017년 4월 22일
답변: David Cazenave 2022년 5월 2일
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 2022년 5월 2일
It's because your trying to convert a symbolic variable into a double precision number.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by