Why does MATLAB only run half of my formula?

2 views (last 30 days)
pbj
pbj on 20 Mar 2015
Commented: Star Strider on 20 Mar 2015
I've set up a function file and a script file in order to solve a set of ODEs.
As well as the 7 ODEs (dx/dt), the function involves several other functions/formulas that rely on time as well as variables from the ODEs.
I've noticed that for example, a function of C=2*t will run fine, changing through every cycle on debugging mode as t varies.
However, when the function is changed as intended to C=1-2*t, the function C remains as 1 for every cycle, even though t is changing.
Does anyone know why this is happening, and how I can solve it?
(I can happily post the code if needed, but it's extremely long, and this is the only bug to my knowledge)
  3 Comments
pbj
pbj on 20 Mar 2015
The actual function that I'm attempting to debug is V=sqrt(1-((t-m*T)/(y*T))^2)), where m, y, and T are predefined functions/variables. However, even starting at high versions of t (running a time course between 20-30s), I still have the same problem.
Star Strider
Star Strider on 20 Mar 2015
It may depend on what ‘m’ and ‘T’ and ‘y’ are, especially with respect to ‘t’.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!