How to multiply two user input expressions?
Show older comments
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 .
Accepted Answer
More Answers (0)
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!