How can I make function value symbolic?

function t = turev(x,y)
.
.
.
end
x = x^2+y^2, y = 1
How can I make the function "x ^ 2 + y ^ 2" symbolic when I enter the values?

Answers (2)

If either of x or y are already symbolic, then any computations done on them will also be symbolic.
You can create a symbolic constant or variable using sym or syms, depending on exactly how you want to do it.
help sym

This question is closed.

Asked:

on 29 Oct 2017

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!