LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting 2-D matrix array

Solved!
Go to solution

I'm having trouble trying to plot the graph of a matrix output, Sk from a MathScript Node.

The Sk parameter should be a (12 x 1) matrix output with step time added.  I can see that its come out as a 3-D array but cannot get the graph of the function to work.

 

What I'm aiming to do...

I need to plot the responses to the 12 separate Row elements of the Sk parameter over time.  This means I need to display 12 separate plots, ideally to be shown on the same graph with an offset on the y-axis to stack the responses (I'm not worried about the relative amplitudes since I'm only interested in seeing step responses in the 12 plots).

 

If anyone can provide some guidance it would be greatly appreciated.

0 Kudos
Message 1 of 7
(3,177 Views)

If it is a 12x1 array before going to the output tunnel, turn it into a 1D array using "index array". This way you get a 2D array after the loop.

 

Your data also seems ot be complex. Do you want it as a xy graph (RE vs IM) or do you simply want to grahp the RE, IM, or magnitude component for each trace?

 

Could you run the VI so the "data incoming" indicator contains typical data. Now make its value the default, save and re-attach the VI.

0 Kudos
Message 2 of 7
(3,163 Views)

Hi Altenbach,

 

I  tried attaching the incoming file dataset_000_0.csv however this NI forum doesn't appear to recognise the uploading of this type of file, neither doe it allow an .xls when re-saved.  The Sk output matrix shouldn't be complex data ?  Maybe something else wrong with my program ?  I've reset it as DBL now.

 

Regards,

Download All
0 Kudos
Message 3 of 7
(3,151 Views)

Hi Altenbach,

 

I  tried attaching the incoming file dataset_000_0.csv however this NI forum doesn't appear to recognise the uploading of this type of file, neither doe it allow an .xls when re-saved.  The Sk output matrix shouldn't be complex data ?  Maybe something else wrong with my program ?  I've reset it as DBL now.

 

Regards,

0 Kudos
Message 4 of 7
(3,149 Views)

It would have been significantly easier for both of us if you would just have made the current values default after running the VI once so the "data incoming" indicator contains data as I requested. All you would have needed was to save and attach the VI again and we can simply turn it into a control and delete all you file IO.

 

 

0 Kudos
Message 5 of 7
(3,139 Views)

Apologies I'm not very familiar with LabVIEW, I didn't know what you meant by "make current values default" that's why I sent the spreadsheet file.  Anyway I've now found the "Make current values default" under the Edit dropdown selection.  The attached file has been run, then "Make current values default" selected, then saved.

 

0 Kudos
Message 6 of 7
(3,130 Views)
Solution
Accepted by topic author bunnykins

Just right-click the SK output tunnel and select data type "1D array, DBL".

 

(The way you are slicing up the array at the beginning is crazy. Why do you create all these mostly redundant data copies??? Simply don't autoindex on the full 2D array and use index array resized to five outputs and wire the first index to the iteration terminal to get the five 1D arrays. You also need to calculate the value wired to N from the number of columns minus four, or similar)

Message 7 of 7
(3,123 Views)