help-octave
[Top][All Lists]
Advanced

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

Re: Newbie, MATLAB, {-indexing incompatibility


From: David Bateman
Subject: Re: Newbie, MATLAB, {-indexing incompatibility
Date: Mon, 31 Jan 2005 18:02:53 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040923)

F L wrote:

Hey,

I found nice MATLAB-code and installed GNU Octave 2.1.50 (for Windows). '--traditional' seems to be on by default.

Some of the code runs. Some doesn't. Here is an offending piece of MATLAB-code:

Vname = [];
lnames = [];

l=1;
for i=1:neqs;
for m=1:nlag;
   Vname{l}  = str2mat(['variable ',num2str(i)]);
   lnames{l} = str2mat(['  lag',num2str(m)]);
l = l+1;
end;
end;


The first innermost line Vname{l}  = str2mat(['variable ',num2str(i)]);
in for-loops contains error according to Octave, but it is supposed to run in MATLAB. I don't know MATLAB-language. What's the left side of assignment supposed to do and how I can circumvent this problem?

error: matrix cannot be indexed with {
error: assignment failed, or no method for `matrix = string'
error: evaluating assignment expression near line 93, column 14
error: evaluating for command near line 92, column 1
error: evaluating for command near line 91, column 1
error: evaluating if command near line 81, column 1
error: evaluating switch command near line 47, column 1

_

This works in 2.1.64...

D.

--
David Bateman                                address@hidden
Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary



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