How can I store an equation as a variable?
Show older comments
I've made a function that determines the parametric equation for a line in 3D. But now I want to plot that line using plot3. I'd like to just store the equation in one place so it's easy to access for plot3. For example I'd like to be able to do the following:
XT = t/4 + 3
YT = 3t/2 - 8
ZT = 1
plot3(XT, YT, ZT)
However, it doesn't want to store unknown variables like t in these equations. What can I do to make this work? Thanks for your time. (P.S. First time using matlab answers and I'm pretty sure I used the markup stuff wrong)
Accepted Answer
More Answers (1)
Walter Roberson
on 22 Jan 2011
0 votes
You can also use symbolic variables if you have the Symbolic Toolbox.
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!