help-octave
[Top][All Lists]
Advanced

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

Re: Help Request


From: Juan Pablo Carbajal
Subject: Re: Help Request
Date: Thu, 29 Sep 2011 17:11:43 +0200

On Thu, Sep 29, 2011 at 11:51 AM, Romanello, Vincenzo
<address@hidden> wrote:
> Dear Ladies and Gentlemen,
>
>
>
> I am trying to switch from MATLAB to OCTAVE (the present version I adopted
> is 3.2.4 – gcc 4.4.0), and I have to read a very simple text file with
> “textread” function.
>
> I wrote the following program:
>
>
>
> function test
>
> clear
>
> disp("Begin")
>
> [a,b,c]=textread("data.txt","%d %d %d");
>
> a
>
> b
>
> c
>
> d=a+b+c
>
> disp("End")
>
> endfunction test
>
>
>
> data.txt looks like this:
>
>
>
> 1 2 3
>
> 4 5 6
>
> 7 8 9
>
>
>
> The point which puzzles me is that the procedure runs recursively until it
> reaches the default limit then giving and error, while I wish obviously to
> run it only once. I tried also to include a number in the textread command
> (as textread("data.txt","%d %d %d",1) or textread("data.txt","%d %d
> %d",-1)), but it doesn’t work. I suspect it is a bug... Is it? Should you
> suggest me something?
>
> Thank you in advance for your kind help.
>
> Best regards
>
>
>
> Vincenzo
>
>
>
>
>
> ****************************************************************************************************
>
> Karlsruhe Institute of Technology (KIT)
>
> Institute for Nuclear and Energy Technologies - IKET
>
>
>
> Dr. -Ing. Vincenzo Romanello
>
> Nuclear Scientist
>
>
>
> Hermann-von-Helmholtz-Platz, 1
>
> Building 421
>
> D - 76344 Eggenstein-Leopoldshafen, Germany
>
>
>
> Phone: +49 (0)721 608-23406
>
> Fax:     +49 (0)721 608-23824
>
> E-mail: address@hidden
>
> Web :   http://www.iket.kit.edu/142.php
>
>
>
> KIT - University of the State of Baden-Wuerttemberg and National Research
> Center of the Helmholtz Association - www.kit.edu
>
> ****************************************************************************************************
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
>

Hi,
First of all,

"endfunction test" is not correct syntax. Use just "endfunction". Does
this solve the error?



-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

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