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

2D array

Hello,

Can we create a 2d array (360x2) such that each element is added at specified index.Right now, I am using replace array subset which needs already existing array which needs to be initialised but I dont want to do that. Can u suggest me a best method to do so?

 

* I am using for loop for adding elements in replace array subset .....N=360, 'i' connected to both indices of rows and 0&1 to indices of columns.

0 kudos
Mensaje 1 de 6
4.174 Vistas

Hi,

 

I'm not sure I understood correctly, but do you know the auto indexing function? That should solve your problem. You can use a for loop inside another for loop to build a 2D array.

In general it is a good idea to initialize the array before as it's more performant normally.

 

Can you post an example of what you try to do or what you have already done?



Remember Cunningham's Law
0 kudos
Mensaje 2 de 6
4.158 Vistas

Hello,

I was trying to convert a cartesian to polar and save it in a tdms file.

0 kudos
Mensaje 3 de 6
4.146 Vistas

OK, so I'm going to start with the important things:

 

Why do you use a local variable here, when you could just connect everything that is now a variable?

The first for loop seems obsolete to me.

 

Aaaand, back to your original problem: you're not updating the array. You load the File fresh every iteration, read 2 values from it, insert them into the (very old) system numeric array 2 and write all of that into a tdms file. What you get is a tdms file that is 360 times as big as you originally intended and has 360 datasets with 1 updated row in it. As I suggested befor: Auto indexing is your friend:

Load the file once, pass the array to a for loop, in it convert, as you've already done, pass it out of the for loop (again, enabling auto indexing) and pass the result to the tdms function. If that doesn't work transpose the 2D array before and after. (not sure about the orientation you get from the file)

 

Other than that I hope you know that there's a boatload of free tutorials out there, which you access to get better acquainted with the old lady we call LabVIEW:

3 Hour Introduction
6 Hour Introduction
LabVEW Basics
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Learning NI
Getting Started with NI Products



Remember Cunningham's Law
Mensaje 4 de 6
4.133 Vistas

Hello,

Actually I don't want to use any array at all.I just want  to take a file path (which consists a cartesian data) ,convert it to polar  and save in a tdms file.

0 kudos
Mensaje 5 de 6
4.086 Vistas
The Read from Spreadsheet returns a 2D array so you have to use that. Make the recommended changes with a single read and a for loop. Post back when that is done and if you still have problems.
0 kudos
Mensaje 6 de 6
4.051 Vistas