provide constant in solve function from an array
显示 更早的评论
I wanted to provide the constant in the equation written from array swingx but on solving i am not getting numerical values in return.but it returns an error instead
swingx=[2:0.2:3 3:0.1:6 6:-(4/35):2];
swingy=[0:0.6:3 3:-0.1:0 repmat(0,1,36)];
mx=repmat(0,1,73);
my=repmat(0,1,73);
syms x;
syms y;
for i=1:73
[mx(i),my(i)] = solve('(x-5)^2+(y-10)^2=25, (x-swingx(i))^2+(y-swingy(i))^2=25');
end
I got the following error instead
??? The following error occurred converting from sym to double:
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 ==> lell at 18
[mx(i) my(i)] = solve('(x-5)^2+(y-10)^2=25,
(x-swingx(i))^2+(y-swingy(i))^2=25');
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Code Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!