Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Reference to a cleared variable
Replies: 12   Last Post: Dec 4, 2013 11:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Ying-Ju Chen

Posts: 6
Registered: 3/30/11
Reference to a cleared variable
Posted: Mar 30, 2011 11:08 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hello everymaster... I have a question that I don't know how to solution ...May u help me? thank you..

My .m........
=============================================
function dhdt = tankfill(t,h)
clc;clear all;
A = 10 + 4*sin(t);
H = 2*sqrt(h);
dhdt = A - H;

tspan = [0 30];
h0 = 1;
[t,h] = ode45('tankfill',tspan,h0);
plot(t,h)
=============================================

command windows below...
==========================
??? Reference to a cleared variable t.

Error in ==> tankfill at 3
A = 10 + 4*sin(t);

>>
==========================



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.