Zarathustra
Zarathustra

Reputation: 145

Symbolic function without body matlab

Is it possible to declare a symbolic function in terms of two other variables without specifying the function body in MATLAB?

I want to have a function $\theta(x,t)$ where $x,t$ are variables. Just declaring $theta$ as a variable makes it $0$ when I take the partial derivatives with respect to $x$ or $y$.

Upvotes: 0

Views: 67

Answers (1)

Ander Biguri
Ander Biguri

Reputation: 35525

syms f(x)
diff(f,x)

returns

ans(x) =
 
diff(f(x), x)

Upvotes: 2

Related Questions