Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Ying-Ju Chen Posts: 6 Registered: 3/30/11
Reference to a cleared variable
Posted: Mar 30, 2011 11:08 PM

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);

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

Date Subject Author
3/30/11 Ying-Ju Chen
3/30/11 Nasser Abbasi
3/30/11 Ying-Ju Chen
3/30/11 Nasser Abbasi
3/30/11 Ying-Ju Chen
3/30/11 Nasser Abbasi
3/31/11 Ying-Ju Chen
3/31/11 Nasser Abbasi
5/29/13 KISHAN
3/30/11 Ying-Ju Chen
3/31/11 Steven Lord
12/4/13 Ying-Ju Chen
12/4/13 Steven Lord