[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fwd: Feature enhancement/matlab compatability
From: |
david . shih |
Subject: |
Fwd: Feature enhancement/matlab compatability |
Date: |
Tue, 08 Mar 2011 20:04:34 -0500 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.1.6) |
----- Forwarded message from address@hidden -----
Date: Tue, 22 Feb 2011 19:25:54 -0500
From: address@hidden
Reply-To: address@hidden
Subject: Feature enhancement/matlab compatability
To: address@hidden
Hi,
I recently started using octave, because I am now convinced that the
unpredictable segmentation fault in my C++ program calling Matlab
scripts is due to linking to Matlab libraries, and there is nothing I
can do about it...
My .m scripts ran using Octave for the most part, except I use the
setfield function.
In Matlab, the setfield function allows the penultimate argument to be
used for array slicing s.t. multiple cells can be set at once.
For example,
a.b = 'b'
a =
b: 'b'
setfield(a, 'a', {1:5}, 10)
ans =
b: 'b'
a: [10 10 10 10 10]
In Octave, using {1:5} for array slicing generates an error to the effect of:
obj.field(1 2 3 4 5)
syntax error
I modified the setfield.m script s.t. setfield can use the penultimate
argument for array slicing. See attached.
It passes both tests found in the original script file.
Regards,
David Shih
Graduate Student, University of Toronto
----- End forwarded message -----
setfield.m
Description: Text Data
- Fwd: Feature enhancement/matlab compatability,
david . shih <=