how to insert an algebraic expression as an input in a function

dear all
i wanna write a function which take an algebric expression and a digit as arguments. then calculate the result of the algebric expression with digit and finally take back the answer. the algebraic expression is " x^2+x" , the digit is "2" and the function is as below:
eq=x^2+x;
function [out]=saeed(eq,2)
now i have 2 problems.
1-the first problem is that should i define x as an symbol?
2-how can i write the function?
thanks alot

답변 (0개)

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

릴리스

R2015a

질문:

2019년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by