help-octave
[Top][All Lists]
Advanced

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

Re: matlab to octave code errors


From: Przemek Klosowski
Subject: Re: matlab to octave code errors
Date: Tue, 9 Jun 2009 11:21:03 -0400 (EDT)

First, you get a warning because Matlab language is biased towards a
development style where procedures are written one at a time into
individual *.m files named after the function defined in the file
(i.e. file xyz.m contains  function x=xyz(a,b) .... endfunction).
You can break this assumption but then Octave and Matlab will have harder
time finding the code, and some nice things won't work, like for instance
reloading the file if you edit the procedure while running the interpreter.
As you can see, this is a warning, so you can ignore it if you prefer.

Unfortunately, your code seems to contain errors: specifically, I think
that it uses uninitialized variable N. From the context, I would guess
that the authors confused I and N:

%----- Coordinates -----
DUMMY = fgets(LINP);
for I=1:NN
   TMP = str2num(fgets(LINP));
   [N, X(N,:)]=deal(TMP(1),TMP(2:1+NDIM));
end




reply via email to

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