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: Adam Spontarelli
Subject: Re: matlab to octave code errors
Date: Tue, 9 Jun 2009 14:28:16 -0400

I apologize, you were right about the input file having a problem. This is the correct .inp file that works in MatLab, however, it still gives me trouble in octave. After applying your fix to line 54, I now get:

error: invalid vector index = 0

error: evaluating binary operator `-' near line 144, column 16

error: evaluating assignment _expression_ near line 144, column 8

error: evaluating for command near line 140, column 1


-Smed



On Tue, Jun 9, 2009 at 14:23, John W. Eaton <address@hidden> wrote:
On  9-Jun-2009, John W. Eaton wrote:

| On  9-Jun-2009, smed wrote:
|
| | Ivan Sutoris wrote:
| | >
| | > Hi
| | >
| | > If it works in Matlab, then probably the "deal" function works
| | > differently in Octave. You can try to rewrite line 54 in two separate
| | > lines (though I didn't test it, as your program requires additional
| | > input files):
| | >
| | > % [N, X(N,:)]=deal(TMP(1),TMP(2:1+NDIM));
| | > N = TMP(1);
| | > X(N,:) = TMP(2:1+NDIM);
|
| It's not a problem with deal, but with the way multi-assignments are
| handled.  Apparently Matlab is creating the variable N before
| evaluating the second element in the assignment and Octave is not.
| This problem should probably be fixed, but as Ivan notes, you can
| easily work around it yourself by using a temporary variable.

I looked at fixing this problem, but I don't see a simple solution.
I'm starting a new thread on the maintainers list about it.

jwe

Attachment: FEM1D.INP
Description: Binary data


reply via email to

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