How to multiply two user input expressions?
显示 更早的评论
How do I multiply two expressions so that I can integrate the outcome after?
My code so far:
function CenterOfMass2
str1 = input('Function f1(x): ','s') ;
str2 = input('Function f2(x): ','s') ;
a = input('Sākuma robeža: ') ;
b = input('Beigu robeža: ') ;
syms x
s=(int(str1,x,a,b)-int(str2,x,a,b));
%k=charpoly(str1,x)*charpoly(str1,x)
%g=charpoly(str2,x)*charpoly(str2,x)
%p=k-g
Mx=int(k,x,a,b)
My=int((x*str2),x,a,b);
coord_x=Mx/s
coord_y=My/s
I understand that charpoly is not correct, but nothing else I've tried has even worked .
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!