Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I am using Mathcad Prime Release 9.0 and Datecode9.0.0.0
Hello.
When reading complex numbers from a text file (1 complex floating point value per line) into a vector, the following phenomenon appears: From the samples 500, 1000, 1500, ... (sample counting 0, 1, 2, ...) only the real part enters into the vector. I searched the vicinity of sample 500 for special characters that are invisible on the screen, but could eventually cause skipping the imaginary part during the reading procedure. I didn't find any special character except 0D and 0A (hex) "carriage return", "line feed"
Here are the errors that I faced
No error message or warning
Solved! Go to Solution.
Ah, I see you are using Prime, and probably used the READFILE function, with "delimited" as the second argument.
Guess there's a bug in that function:
You should consider reporting that bug.
Unfortunately READPRN is not capable (anymore) to read such files. Seems like PTC managed to ruin that function going from Mathcad to Prime:
But there's a work-around. If you edit the .txt file with notepad, replace all + with a space character and all i with nothing and save the result (as a text file with e.g. extension ".PRN" instead of txt), you can read this file with READPRN. You get a matrix with two columns as I showed earlier, from which you can reconstruct the array of complex values.
Success!
Luc
Please upload your text file here.
The textfile is named "224015_TFHF_sm_trunc300Hz.txt". No header, One column, One complex number per line.
Ah, I see you are using Prime, and probably used the READFILE function, with "delimited" as the second argument.
Guess there's a bug in that function:
You should consider reporting that bug.
Unfortunately READPRN is not capable (anymore) to read such files. Seems like PTC managed to ruin that function going from Mathcad to Prime:
But there's a work-around. If you edit the .txt file with notepad, replace all + with a space character and all i with nothing and save the result (as a text file with e.g. extension ".PRN" instead of txt), you can read this file with READPRN. You get a matrix with two columns as I showed earlier, from which you can reconstruct the array of complex values.
Success!
Luc
What did you use to read the file.
I used READPRN, resulting in a 2 column matrix, the first column contains the real parts, the second column contains the imaginary parts:
Success!
Luc
This issue has been reported to PTC R&D to determine how to resolve the issue
Status:
CS401987 Reading complex numbers from a text file (1 complex floating point value per line) into a vector using READFILE() or READTEXT() works fine, except that lines 500, 1000, 1500, etc. get just the real part, miss the complex part in Mathcad Prime