help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: non-integer passed to boolean operator


From: Martin Helm
Subject: Re: non-integer passed to boolean operator
Date: Thu, 29 Jul 2010 21:43:32 +0200
User-agent: KMail/1.12.4 (Linux/2.6.31.12-0.2-desktop; KDE/4.3.5; x86_64; ; )

Am Donnerstag, 29. Juli 2010 21:26:23 schrieb Jaroslav Hajek:
> On Thu, Jul 29, 2010 at 6:08 PM, yi lu <address@hidden> wrote:
> > I have written the following script for a function. Each step is correct
> > and I've checked the function itself is also correct. However, when I
> > went to the final step, plot. it shows error.
> > gnuplot> a(x)=91.25e-21*x
> > gnuplot> b(x)=0.8125/x
> > gnuplot> T1(x)=(sin((1-a(x))*b(x)))**2/((1-a(x))**2)
> > gnuplot>
> > T2(x)=(N*0.927*sin(b(x))*sin(a(x)*b(x))*sin((1-a(x))*b(x)))/(a(x)*(1-a(x)
> >)) gnuplot>
> > T3(x)=(S*0.927*cos(b(x))*sin(a(x)*b(x))*sin((1-a(x))*b(x)))/(a(x)*(1-a(x)
> >)) gnuplot> T4(x)=0.5*0.86*(sin(a(x)*b(x)))**2/((a(x))^2)
> > gnuplot> Y(x)=(0.08*T1(x)-d*0.2828*T2(x)+d*0.2828*T3(x)+(d**2)*T4(x))
> > gnuplot> plot N=0, S=0, Y(x);plot N=0, S=1, Y(x)
> >          non-integer passed to boolean operator
> 
> You are at the wrong list; this is Octave list, not Gnuplot. Most
> likely your problem is the ^ operator, which is bitwise xor in
> Gnuplot.
> 
That is correct the ^ is the problem, replacing
^ by ** leading to

T4(x)=0.5*0.86*(sin(a(x)*b(x)))**2/((a(x))**2)

makes it work (for testing I set d to 1 which is otherwise undefined).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]