comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Transpose of string along with float variable??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Transpose of string along with float variable?? [message #93907 is a reply to message #93906] Wed, 23 November 2016 03:38 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Wednesday, November 23, 2016 at 12:08:45 PM UTC+1, Sapna Mishra wrote:
> Hello every one,
>
> Can any one tell me how to print transpose of arrays which includes array of
> string, float and integers together??
>
> Eg. s=['dog','cat','monkey ' ]
> n=[1,2,3]
> x=[100.0,109.0,111.0]
> when I am doing :
> IDL> print,transpose( [ [n],[s],[x] ])
> I get:
>
> % Type conversion error: Unable to convert given STRING to Integer.
> 1 0 100
> 2 0 109
> 3 0 111
> I want to print:
> 1 dog 100.0
> 2 cat 109.0
> 3 monkey 111.0
>
> I know its just a small problem but I am using such things in my big complicated code.

Probably not what you were looking for, but how about this?

print,transpose( [ [string(n)],[string(s)],[string(x)] ])
1 dog 100.000
2 cat 109.000
3 monkey 111.000

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to infer number of minor ticks?
Next Topic: write_png help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:48:14 PDT 2025

Total time taken to generate the page: 0.00381 seconds