03-26-2012 01:03 PM
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.
Solved! Go to Solution.
03-26-2012 03:47 PM
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.
03-26-2012 09:40 PM
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,
03-26-2012 09:48 PM
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,
03-27-2012 01:30 AM
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.
03-27-2012 08:23 AM
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.
03-27-2012 09:25 AM
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)