From: Brandon on 3 Dec 2009 18:50 I have written the following code and I am trying to make a movie, but I receive the error ??? Subscript indices must either be real positive integers or logicals. Why does this happen? Error in ==> P4_2 at 14 M(t)=getframe; kappa = 1*10^-12; %mm^2/s Ts = 86400; %temperature fluctuation in section To = 20; %initial temperature in celsius deltaT = 5; %change in temperature in celcius t = 0; omega = 2*pi/Ts; z = 0:150; alpha = sqrt(omega/(2*kappa)); for t=0:1:100 T = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); M(t)=getframe; end Movie(M) dw = sqrt(2*kappa/omega) %skin depth depth = pi/(sqrt(omega/(2*kappa))) %depth at 180 degrees out of phase T1 = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); figure(1); plot(T,z) xlabel('Temperature (C)') ylabel('Depth (km)') set(gca,'ydir','reverse')
From: Brandon on 3 Dec 2009 19:30 Despite all the triple posting, I still need assistance with this question! "Brandon " <bflickinger(a)umail.ucsb.edu> wrote in message <hf9irt$fae$1(a)fred.mathworks.com>... > I have written the following code and I am trying to make a movie, but I receive the error ??? Subscript indices must either be real positive integers or logicals. > Why does this happen? > > Error in ==> P4_2 at 14 > M(t)=getframe; > > kappa = 1*10^-12; %mm^2/s > Ts = 86400; %temperature fluctuation in section > To = 20; %initial temperature in celsius > deltaT = 5; %change in temperature in celcius > t = 0; > omega = 2*pi/Ts; > z = 0:150; > alpha = sqrt(omega/(2*kappa)); > > for t=0:1:100 > T = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); > M(t)=getframe; > end > Movie(M) > > dw = sqrt(2*kappa/omega) %skin depth > depth = pi/(sqrt(omega/(2*kappa))) %depth at 180 degrees out of phase > T1 = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); > > > figure(1); > plot(T,z) > xlabel('Temperature (C)') > ylabel('Depth (km)') > set(gca,'ydir','reverse')
From: Brandon on 3 Dec 2009 19:33 Despite all the triple posting, I still need assistance with this question! "Brandon " <bflickinger(a)umail.ucsb.edu> wrote in message <hf9irt$fae$1(a)fred.mathworks.com>... > I have written the following code and I am trying to make a movie, but I receive the error ??? Subscript indices must either be real positive integers or logicals. > Why does this happen? > > Error in ==> P4_2 at 14 > M(t)=getframe; > > kappa = 1*10^-12; %mm^2/s > Ts = 86400; %temperature fluctuation in section > To = 20; %initial temperature in celsius > deltaT = 5; %change in temperature in celcius > t = 0; > omega = 2*pi/Ts; > z = 0:150; > alpha = sqrt(omega/(2*kappa)); > > for t=0:1:100 > T = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); > M(t)=getframe; > end > Movie(M) > > dw = sqrt(2*kappa/omega) %skin depth > depth = pi/(sqrt(omega/(2*kappa))) %depth at 180 degrees out of phase > T1 = To + deltaT*exp(-alpha*z).*cos(omega*t-alpha*z); > > > figure(1); > plot(T,z) > xlabel('Temperature (C)') > ylabel('Depth (km)') > set(gca,'ydir','reverse')
From: dpb on 3 Dec 2009 19:38 Brandon wrote: > Despite all the triple posting, I still need assistance with this question! > > "Brandon " <bflickinger(a)umail.ucsb.edu> wrote in message <hf9irt$fae$1(a)fred.mathworks.com>... >> I have written the following code and I am trying to make a movie, >> but I receive the error >> ??? Subscript indices must either be real positive integers or logicals. >> Why does this happen? >> >> Error in ==> P4_2 at 14 >> M(t)=getframe; >> .... What is t at that point in debug or w/ disp(t) ?? Somehow it appears ML thinks it isn't an integer...find out why. --
From: Brandon on 3 Dec 2009 19:50 dpb <none(a)non.net> wrote in message <hf9lmn$qt0$1(a)news.eternal-september.org>... > Brandon wrote: > > Despite all the triple posting, I still need assistance with this question! > > > > "Brandon " <bflickinger(a)umail.ucsb.edu> wrote in message <hf9irt$fae$1(a)fred.mathworks.com>... > >> I have written the following code and I am trying to make a movie, > >> but I receive the error > >> ??? Subscript indices must either be real positive integers or logicals. > >> Why does this happen? > >> > >> Error in ==> P4_2 at 14 > >> M(t)=getframe; > >> > ... > > What is t at that point in debug or w/ > > disp(t) ?? > > Somehow it appears ML thinks it isn't an integer...find out why. > > -- I'm not sure I understand. My code looks exactly like the example provided in Matlab help and i'm not sure why it wouldn't think that t was an integer.
|
Next
|
Last
Pages: 1 2 3 Prev: uitable: change column width Next: GUIDE: 'Bring to front' moves other GUI objects |