The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 converting text to complex numbers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marek_888

Canada
2 Posts

Posted - 07/26/2017 :  1:37:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2016
Operating System: Windows10
I imported ASCII file which contained columns of complex numbers. Origin sees them as text. Changing Column properties to Numeric/COmplex results in "--" output. How can I either convert the columns to complex numerical values or importin such a way that Origin recognizes the data as complex numbers.

Marek

YimingChen

1613 Posts

Posted - 07/26/2017 :  5:14:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Marek,

Assume you have complex numbers stored in col(A) with string format “a + bi”, double click the column header of col(B) to launch the column property dialog. Under the Options node, change Format to Numeric, change Data Type to Complex(16). Then setting column value of col(B) to col(A) will gives complex numbers.

Hope this answers your question.

Thanks,
Yiming

Edited by - YimingChen on 07/26/2017 5:33:34 PM
Go to Top of Page

marek_888

Canada
2 Posts

Posted - 07/26/2017 :  6:00:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Yiming

Thank you for your response. Unfortunately your method does not work for me. Since I do not know Origin scripting language it is hard to comment on why it is the case. I thought that The line which is looking for "-" is causing a problem since my data includes numbers with negative exponents (like 1.2e-006). Removing that line does not fix the problem however.
But I managed to separate my data on import into real and imaginary parts by defining appropriate delimiters. Luckily my data is always of the form "a+bi" and never "a-bi".

Marek
Go to Top of Page

arstern

USA
237 Posts

Posted - 07/28/2017 :  11:22:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I believe you will need to set the worksheet columns to complex numbers before importing the data. If you import the data into the worksheet and then set the column to complex, you will get --.

The format is also important:

"a + bi" will work
"a+bi" will give you something different.

Hope this helps,
Aviel
OriginLab

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000