Re: if statement help



Hi Walter,
is it possible you could help me further?
It appears that the script is working as there are no erros
showing but now,the matlab says its 'busy' and after 10 mins
is still not showing and graph display or error, this is the
code i used:

i=2; newpressure(1:length(pressure))=0;
while i <= length(pressure)
if ((newpressure(i) <
newpressure(i-1))&&((newpressure(i-1)-newpressure(i))>=150))
newpressure(i:i+5)=pressure(i);
end
i=1+5;

for j=i:length(pressure)

newpressure(j)=(pressure(j)-pressure(j-1))+newpressure(j-1);
end
i=1+1;
end

i've then continued with my script:
case1 = (newpressure < 673.2);
case2 = (newpressure < 995.7);
case3 = (newpressure >= 995.7 & newpressure < 1149.2);
case4 = (newpressure >= 1149.2);
volume = zeros(size(newpressure));
volume(case1) = 0;
volume(case2) = ((newpressure(case2)-442.95)*5.365);
volume(case3) = ((newpressure(case3)-749.29)*12.034);
volume(case4) = ((newpressure(case4)-934.08)*22.371);


roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson) wrote in
message <futmvj$ncp$1@xxxxxxxxxxxxxxxxxxxxxxx>...
In article <futm6u$6tc$1@xxxxxxxxxxxxxxxxxx>,
Adam Bright <abc_services_2000@xxxxxxxxxxx> wrote:
Hi, I've been trying to play around with it but I get the
following error:
??? Subscript indices must either be real positive integers
or logicals.

Error in ==> untitld at 3
if( ((A(i) < A(i-1))&&((A(i-1)-A(i))>=150)) )


A=[1500;1600;1793.00;1810.00;1827.00;1827.00;1845.00;1861.00;1876.00;1891.00;1686.00;1178.00;709.90;722.90;771.70;818.00;861.00;904.00;]
while(i < length(A)-5)
if( ((A(i) < A(i-1))&&((A(i-1)-A(i))>=150)) )

What is 'i' initialized to? There is no initialization
shown here.
Could i be 0? Could i be 1? If i is 1 then A(i-1) would be
A(0)
and 0 is not a real positive integer
--
"Okay, buzzwords only. Two syllables, tops." -- Laurie
Anderson

.



Relevant Pages

  • Re: Q:show output from script
    ... > I have a problem showing output that is comming from a script. ... > commandline it do save everything but from software it would not. ... posting here, use a standard function, e.g.: ...
    (comp.lang.cpp)
  • O2K vbe error message "Cant find project or library"?
    ... even though my original versions showing up okay. ... I'm have trouble with a script in my O2K. ... strMsg = "Do you want to run the macro to expand all the ...
    (microsoft.public.outlook.program_vba)
  • Re: Q:show output from script
    ... > I have a problem showing output that is comming from a script. ... > commandline it do save everything but from software it would not. ... C++ Faq: http://www.parashift.com/c++-faq-lite C Faq: http://www.eskimo.com/~scs/c-faq/top.html alt.comp.lang.learn.c-c++ faq: ...
    (comp.lang.cpp)
  • Oratcl 4.1 - Static build Question
    ... database from Tcl scripts. ... code for Oratcl initialization, like Tcl_StaticPackage? ... Also I've found on the Web the Makefile for building oratcl as static ... but oratcl4.1 distribution doesn't have this script... ...
    (comp.lang.tcl)
  • Re: Run VBScript as Task in 32 Bit Mode
    ... And you don't have a hint about where the error is showing up, of course, with that kind of result. ... Post the script as-is (munging database passwords of course) so we can take a look at possible issues. ... That could be troublesome if it's lengthy, and it would be almost unmanageable unless all lines are less than 76 chars long since the script would get serious mangling. ... The script has worked for years in a SBS 2003 environment as a scheduled task. ...
    (microsoft.public.scripting.vbscript)

Loading