[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: octave 3.2.4 - sprintf error message
From: |
Claudio Belotti |
Subject: |
Re: octave 3.2.4 - sprintf error message |
Date: |
Sun, 31 Oct 2010 13:33:28 +0000 |
the error is that
VL_STIEL_LINIE(2)
doesn't return a string but a cell
octave-3.2.2:9> VL_STIEL_LINIE(2)
ans =
{
[1,1] = b
}
you need to use curly brackets VL_STIEL_LINIE{2} to get the content ,
i.e. the string "b"
octave-3.2.2:10> VL_STIEL_LINIE{2}
ans = b
octave-3.2.2:11> VL_TEST=sprintf("String ->%s<-",VL_STIEL_LINIE{2})
VL_TEST = String ->b<-
Claudio
On Fri, Oct 29, 2010 at 10:42, <address@hidden> wrote:
> Dear Users,
>
> we like to switch in the near future from Version 3.0.5 to 3.2.4 and getting
> an error message in the early tests with 3.2.4.
>
> We are using the following script in 3.0.5 and 3.2.4:
>
> # cat rwu_test_sprintf.m
> 1
> 2 VL_STIEL_LINIE_ROH= ["a";"b";"c"];
> 3
> 4 VL_STIEL_LINIE=cellstr(VL_STIEL_LINIE_ROH);
> 5
> 6
> 7 VL_TEST=sprintf("String ->%s<-",VL_STIEL_LINIE(2))
>
> After executing the script in 3.0.5 we get this result: VL_TEST = String ->b<-
>
> In 3.2.4 we get this error:
>
> error: sprintf: wrong type argument `cell'
> error: called from:
> error: ./rwu_test_sprintf.m at line 7, column 8
>
> (I added the line numbers above in the script for better reference to the
> error message)
>
> Anyone have an idea what's the problem?