Plotting and tables

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Plotting and tables

Daniel Tourde-3
Hello,

I have two questions :
        I would like to define a string x="Hi evrybody"
        and to set gset title x for the plotting. This syntax is not
accepted. Of course if I use gset title "Hi evrybody" it works but, my
idea is to insert into the x string some variables with the sprintf
function. e.g : a=1
                x=sprintf("a=%d",a)
                gset title x
How can I do ?



        I would like to create tables of number with a rank > 2.
        A matrix is a 2 dimension number table. I would like to create a
three dimension number table reachable via A(1,2,3) for instance. How
can I do ?

I thank you in advance for your advices

Best regards

                        Daniel
--
*********************************************************************
Daniel TOURDE E-mail : [hidden email]
The Aeronautical Research Institute of Sweden Tel : +46 8 634 13 44
P.O. Box 11021 S-161 11 BROMMA, Sweden Fax : +46 8  25 34 81
*********************************************************************

Reply | Threaded
Open this post in threaded view
|

Re: Plotting and tables

Andres Weingessel
>>>>> On Fri, 14 Mar 1997 12:53:30 +0100,
>>>>> Daniel Tourde wrote:

> Hello,
> I have two questions :
> I would like to define a string x="Hi evrybody"
>         and to set gset title x for the plotting. This syntax is not
> accepted. Of course if I use gset title "Hi evrybody" it works but, my
> idea is to insert into the x string some variables with the sprintf
> function. e.g : a=1
>                 x=sprintf("a=%d",a)
> gset title x
> How can I do ?

Try
octave:1> x="hello world";
octave:2> eval(sprintf("gset title '%s'",x))

The above example could be implemented as

octave:3> a=1;
octave:4> eval(sprintf("gset title 'a=%d'",a))



> I would like to create tables of number with a rank > 2.
>         A matrix is a 2 dimension number table. I would like to create a
> three dimension number table reachable via A(1,2,3) for instance. How
> can I do ?

I would like this too!

You could try to create matrices a1,a2,a3,... . Then,

        eval(sprintf("a%d(2,3)",1))

gives the (2,3) element of matrix a1. But, of course that's not the
same as having multidimensional arrays.

Best Regards,
        Andreas

************************************************************************
*                          Andreas Weingessel                          *
************************************************************************
* Institut für Statistik      *                Tel: (+43 1) 58801 4541 *
* Technische Universität Wien *                Fax: (+43 1)  504 14 98 *
* Wiedner Hauptstr. 8-10/1071 *     [hidden email] *
* A-1040 Wien, Austria        * http://www.ci.tuwien.ac.at/~weingessel *
************************************************************************