Dear All,

I have the following code:

clc

clear all

close all

f=@(x,y)x^2+y;

f=sym(f);

out=subs(f,x,2)

Could you please tell me what should I do to prevent getting an error.

Thanks a lot.

Skip to content# MATLAB: How to use subs with sym

subs sym

Dear All,

I have the following code:

clc

clear all

close all

f=@(x,y)x^2+y;

f=sym(f);

out=subs(f,x,2)

Could you please tell me what should I do to prevent getting an error.

Thanks a lot.

## Best Answer