Dynamic changing values
Show older comments
Hello, I have a question about dynamic changing values.
A list of values (or maybe vectors or maybe matrices): a, b, c, d, e, f, ... ...
There are equations between a, b, c, and d, e, f
---------------
*a* , b, c,
---------------
*d*, e, f ....
---------------
a = x1*b + x2 * c
d = x1*e + x2 * f
values *a* depends on value b and c
values *d* depends on value e and f
x1, x2 are two constant,
And b, c, e, f are variables, their values keep updating in a loop. How to update a, d's values dynamically once b, c, e, f are changed?
I see matlab has no pointer like C, C++. Can matlab do changing values dynamically?
Thanks in advance for your help!
Accepted Answer
More Answers (2)
Jiro Doke
on 8 Mar 2011
Just redefine a and d after you update the other values:
for id = 1:100
a = x1*b + x2 * c
d = x1*e + x2 * f
...
<do your stuff>
...
<update b, c, e, f>
end
Daniel Shub
on 8 Mar 2011
Seems like this might be related to the polynomial class example included in the OOP guide
web([docroot '/techdoc/matlab_oop/f3-39071.html'])
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!