help-octave
[Top][All Lists]
Advanced

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

Re: two questions -- one remaining


From: Henry F. Mollet
Subject: Re: two questions -- one remaining
Date: Tue, 13 Sep 2005 14:05:27 -0700
User-agent: Microsoft-Entourage/11.1.0.040913

Joe,
It was supposed to be Unix but apparently it was not.

Textfile was pasted into 'Smultron' text editor (Swedish for wild
strawberry). It has line numbers but no hex dump. I thought it would use
Unix line termination. By the way, thanks for telling me about it some time
ago. 

So I took mine.m into BBEdit which has a hexdump and the final two code
lines are:
0500: 79 6C 61 62 65 6C 28 27 45 78 74 72 61 63 74 69     ylabel('Extracti
0510: 6F 6E 27 29 3B 0D 20 0D                             on');. .
So indeed it was pernicious Mac line termination i.e. invalid character `\r'
(ASCII 13= Hex 0D).

So after saving with Unix line termination I got a little farther with
mine.m:
octave:28> mineBBEditUnix
MINE MANAGEMENT MODEL
error: `gridmake' undefined near line 22 column 14
error: near line 22 of file `/Users/hfm/Documents/CandO/mineBBEditUnix.m'
Henry




on 9/12/05 8:20 PM, Joe Koski at address@hidden wrote:

> Henry,
> 
> Could the input text file have the wrong line endings for your machine? I
> have all sorts of problems when my octave file line endings aren't set for
> for UNIX.
>  
> Joe
> 
> on 9/12/05 8:41 PM, Henry F. Mollet at address@hidden wrote:
> 
>> I don't have an explanation but I tried your script as is and got nothing
>> i.e. no plots nor any errors. Then I replaced the first figure statement
>> with gset term aqua and "all hell broke loose". I've repeated it twice with
>> same results.
>> There is however no invalid character character at line 2:
>> octave:7>   fprintf('\nMINE MANAGEMENT MODEL\n')
>> MINE MANAGEMENT MODEL
>> Therefore the error must be elsewhere. I would proceed line by line to find
>> the error.
>> Henry
>> %  figure(1);       % line 42
>> gset term aqua 1    % new line 43
>> octave:7> mine
>> error: invalid character `\r' (ASCII 13) near line 2, column 18
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                     ^
>> 
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   syntax error
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                                      ^
>> 
>> error: invalid character `\r' (ASCII 13) near line 2, column 36
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                                       ^
>> 
>> error: invalid character `\r' (ASCII 13) near line 2, column 71
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                                                                          ^
>> 
>> error: invalid character `\r' (ASCII 13) near line 2, column 107
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                 
>> ^
>> 
>> error: invalid character `\r' (ASCII 13) near line 2, column 109
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                 
>> ^
>> 
>> error: invalid character `\r' (ASCII 13) near line 2, column 110
>> parse error near line 2 of file /Users/hfm/Documents/CandO/mine.m
>> 
>>   xlabel('Stock'); ylabel('Extraction');
>>                 
>> ^
>> 
>> 
>> 
>> 
>> on 9/12/05 12:03 PM, address@hidden at address@hidden wrote:
>> 
>>> Hello,
>>> 
>>> thank your for your quick answers. I tried your suggestions, but still I
>>> have
>>> the problem.
>>> 
>>> Joe:
>>>> Klári,
>>>> 
>>>> In Octave, plotting is done with with a separate program, gnuplot.
>>>> Whilemany of the plot commands are the same, the order of the
>>>> commands differs.
>>>> Try placing the plot command after the title, xlabel, etc. If you
>>>> still have
>>>> problems, try setting automatic_replot=0.
>>>> 
>>>> Joe
>>> I have 2.1.71 version and octave-forge is also installed. I followed your
>>> instructions but the problem remained. What I dont understand is that other
>>> mfiles work pretty well with the same syntax for plot command.
>>> 
>>> 
>>> Doug:
>>>> The plot command automatically starts up GNUPLOT  and sends the
>>>> info to 
>>>> it through a pipe.
>>>> 
>>>> If after you have drawn a plot you then close GNUPLOT and try to
>>>> plot 
>>>> another plot it will act like you have reported.  So the solution
>>>> is to 
>>>> leave GNUPLOT there and let octave handle GNUPLOT.
>>>> 
>>>> If you have shut down GNUPLOT then you must restart Octave to get
>>>> it 
>>>> back again.
>>>> Doug
>>> I am sorry for being so beginner I do not even know how to close gnuplot. If
>>> you think the commented line of the previous version of my mfile, so I
>>> deleted
>>> all close command from my file (this is a heritage from matlab:), restarted
>>> octave and the problem remained.
>>> 
>>> I am very confused because it sometimes works, sometimes doesnot, I feel
>>> myself very silly. Roughly I might say that plot command works pretty well
>>> at
>>> the command line + in all other mfiles I have with the only exception I
>>> mentioned last time. So I thought if some of you might have a good idea
>>> where
>>> to start searching my mistakes...
>>> 
>>> thank you again
>>> 
>>> Klári
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -------------------------------------------------------------
>>> 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
>> -------------------------------------------------------------
>> 
> 
> 





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



reply via email to

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