[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question regards MATLAB code running on Octave
From: |
Joao Cardoso |
Subject: |
Re: Question regards MATLAB code running on Octave |
Date: |
Wed, 06 Oct 1999 03:56:15 +0100 |
Kanuengnij Kubola wrote:
>
> Hi ,
> I just start using Octave. I got a problem to run the MATLAB Code on
> Octave. Can anyone point me out about this or where I can look at about this
> problem? Thanks a lot.
>
> #1. about switch (), Here's the example of the problem
> a = 'test'
> switch (a)
> case 'notatest'
> disp("This is not a test")
> case 'test'
> disp("Successful test!!")
> end
>
> This code, it works OK on MATLAB, but it gives some error on Octave that is
> error: operator ==: nonconformant arguments (op1 is 1x4, op2 is 1x8)
Obviously an (user) bug. The strings under comparison must have the same
length. I guess that each `case' just compare its arguments, and if they
are vectors they must have the same length. `switch' is nothing more
than `if-then-else'.
As a fix, you should try using `postpad' to make your argument the same
length as each comparison case.
But octave could be corrected, I guess.
Joao
>
> Does anyone familiar with this problem? Could you please help me out?
>
> nid
>
> ____________________________________________________________________
> Get free email and a permanent address at http://www.netaddress.com/?N=1
>
> ---------------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL. To ensure
> that development continues, see www.che.wisc.edu/octave/giftform.html
> Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
> ---------------------------------------------------------------------
--
Joao Cardoso, INESC | e-mail:
R. Jose Falcao 110 | tel: + 351 2 2094345
4050 Porto, Portugal | fax: + 351 2 2008487
---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL. To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------