[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: script failure with 2.1.50
From: |
Henry F. Mollet |
Subject: |
Re: script failure with 2.1.50 |
Date: |
Tue, 17 Feb 2004 09:46:28 -0800 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
I've tried the commands in your script at the octave prompt and I got a
plot.
Henry
octave:2> Ew = 1.0;
octave:3> Tp = linspace(100*Ew, 0.1*Ew, 2048);
octave:4> for i = 1:length(Tp)
> f(i) = 1.0 - ((ceil(Ew/Tp(i)) - (Ew/Tp(i)))*Tp(i) + Ew)^-1/(Tp(i)^-1);
> Tr(i) = 1.0/Tp(i);
> endfor
octave:5> whos
*** local user variables:
prot type rows cols name
==== ==== ==== ==== ====
rwd scalar 1 1 Ew
rwd matrix 1 2048 Tp
rwd matrix 2048 1 Tr
rwd matrix 2048 1 f
rwd scalar 1 1 i
octave:6> plot(Tr, f); % worked and produced a curve f=0 from Tr = 0 to 1,
then a step to 0.5, then a slanted step, then smoothing out and increasing.
"Default" x-axis from 0-10, "default" y-axis from -0.1 to 0.9.
on 2/17/04 7:41 AM, John W. Eaton at address@hidden wrote:
> On 17-Feb-2004, daron <address@hidden> wrote:
>
> | Using FreeBSD 4.9 ( octave was compiled from the ports collection), this
> | simple script fails :
> |
> | #! /usr/local/bin/octave -q
> |
> | Ew = 1.0;
> |
> | # Generate vector of trigger periods
> |
> | Tp = linspace(100*Ew, 0.1*Ew, 2048);
> |
> | # Calculate fraction: missed events = 1 - (EventRate/TriggerRate)
> |
> | # and trigger rates
> |
> | for i = 1:length(Tp)
> |
> | f(i) = 1.0 - ((ceil(Ew/Tp(i)) - (Ew/Tp(i)))*Tp(i) + Ew)^-1/(Tp(i)^-1);
> |
> | Tr(i) = 1.0/Tp(i);
> |
> | endfor
> |
> | plot(Tr, f);
> |
> | pause();
> |
> | The error message is :
> |
> | ./ideal.m: line 4: Ew: command not found
> | ./ideal.m: line 7: syntax error near unexpected token `('
> | ./ideal.m: line 7: `Tp = linspace(100*Ew, 0.1*Ew, 2048);'
> |
> | Could someone please shed some light on a possible cause/fix ? The
> | script works fine with an older octave version ( 2.1.34, I believe ) on
> | a Linux machine.
>
> Those don't look like Octave error messages, so I think something
> other than Octave is trying to run the script. Perhaps your command
> shell?
>
> Where is Octave installed? Is it in /usr/local/bin or some other
> directory? If it is not in /usr/local/bin, then you need to modify
> the first line of your script.
>
> (Sorry about the double posting of your message. I forwarded it to
> the list before I noticed that you had subscribed and reposted it.)
>
> jwe
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------