cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

Array with Complex Numbers

I am attempting to export an array with complex numbers in the form x+yi to a txt file. We need this form as opposed to two columns with separate values because MATLAB needs it in the form x+yi. Right now it is only writing the x value to the txt file. Do I maybe need to change the format for Write Delimited Spreadsheet? Any suggestions would be appreciated. 

0 kudos
Mensaje 1 de 17
3.432 Vistas

I'd use Complex to re/im and format it manually, but there might be some hidden gem that automates that. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Mensaje 2 de 17
3.429 Vistas

Hi mn,

 

as you forgot to attach your VI we cannot tell you what you did wrong!

 

For me it works as expected:

 


@mnwooddog wrote:

Right now it is only writing the x value to the txt file. Do I maybe need to change the format for Write Delimited Spreadsheet?


As you forgot to attach your VI we cannot see the coercion dot in your code which warns you about (unexpected?) datatype conversions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Mensaje 3 de 17
3.426 Vistas

GerdW is close.  You just have to search and replace the SPACES with NOTHING  Matlab hates the dang space as I recall.


"Should be" isn't "Is" -Jay
Mensaje 4 de 17
3.393 Vistas

I've attached the VI (but it's very convoluted with everything we're doing, so I've also attached a screenshot on the area I'm focused on). 

Descargar todos
0 kudos
Mensaje 5 de 17
3.387 Vistas

I will give your method a try. I've replied to my original post with the VI and a screenshot of the specific area I'm addressing

0 kudos
Mensaje 6 de 17
3.383 Vistas

See that ugly red colored dot on the orange wire?  That is where your Complex Double is Coerced to Double


"Should be" isn't "Is" -Jay
0 kudos
Mensaje 7 de 17
3.378 Vistas

Oh, I see! How do I fix that?

0 kudos
Mensaje 8 de 17
3.366 Vistas

How would you then output your spreadsheet string to a txt file? How I have it set up now there is an output of Build Path connected to an output of Array to Spreadsheet String. 

0 kudos
Mensaje 9 de 17
3.355 Vistas

Hi mn,

 


@mnwooddog wrote:

How would you then output your spreadsheet string to a txt file?


When I want to write strings to a textfile then I use a simple WriteTextFile function.

Sounds very logical to me…

 


@mnwooddog wrote:

How I have it set up now there is an output of Build Path connected to an output of Array to Spreadsheet String. 


Again you forgot to attach your VI so we cannot tell you what you did wrong in your VI…

But how do you connect the output of one function to the output of another function???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 kudos
Mensaje 10 de 17
3.336 Vistas