user9003011
user9003011

Reputation: 306

How to get value of symbolic expression for further processing

When using symbolic expression, the question is how to convert symbolic value to discrete value and obtain z value.

x=2
syms x
y=x^2

z=x+y

Upvotes: 1

Views: 92

Answers (1)

Jose Marques Junior
Jose Marques Junior

Reputation: 133

syms x y
y = x^2
z = x+y

y_function = matlabFunction(y);
z_function = matlabFunction(z);

x = 2;
z_function(2)

Upvotes: 1

Related Questions