Multiple plots to same chart in LabVIEW - charts

I am doing a two-channel data acquisition to read out the voltages of two diodes. I am using LabVIEW to do this. Below you can see the part of the code relevant for my question.
The voltages are converted to temperatures by 1D interpolation, as shown in the above code. 0.9755 V corresponds to 2 degrees, 1.68786 V to 100 degrees. For this simple example, I expected the waveform chart to display two constant curves, one at 2 and one at 100. However, it plots only one curve that zigzags between the two values. How can I get two separate plots?

Add "Index Array" at the "yi" output of the "Interpolate 1D VI" function and expand it to two elements. Then put "Bundle" function with two inputs. Connect "Index Array" outputs to them. The resulting cluster connect to the chart.
That's it :)
Explanation: to display multiple plots in the chart, you need to feed it with a cluster, not an array. Your "Interpolate 1D VI" output gives you 2-element array (result of interpolation for 0.9755 and 1.68786), so you need to convert it to a cluster using Bundle function.

The general answer to this question is that if you open the context help and hover over the BD terminal of a graph or chart, you will see the various data types it supports:
This will help if you want to get it right every time, as the various charts and graphs can each take different types of data to display different types of graphs and remembering them can be tricky.

Related

Vorticity not showing up in Paraview

I have a snapshot of a 3D field whose domain is a cube. I need to visualize the vorticity associated with this field. I am following the approach described by this video in which the vorticity gets calculated by ParaView.
I followed the procedure but, inside the filter Compute derivatives / Coloring, I cannot find the vorticity but only the components of the starting field as you can see from the following picture:
I read that another method is to use the filter for unstructured data but I don't have such a filter.
How should I properly visualize the vorticity?
I am using ParaView 5.10.
In your screenshot, the value for Vectors property shows a (?), meaning that it is not a valid input. You should select an existing vector arrays here.

Matlab: Comparing two signals with different time values and placed impulses

We are analysing some signals that contains an impuls in the form of a dip in the standard signal in matlab.
Signals
As you can see on the picture, we need to find the difference between the "Zlotty" and the "Krone". The two graphs besides each other, are the graphs that needs to be analyzed.
As you can see the time of the impulse is different in when it occures and in how long the impuls is. We can not use the Time as a value of measurements because that can vary randomly.
Each graph is made by vectors containing 2.5mio datapoints.
How would you use matlab to find a difference?
You could split the problem into two parts. Ensuring the same time scale for both signals and finding a possible time shift in the alignment of the resulting signals. The first part could be achieved by using the resample function of Matlab; and the second task by using cross-correlation. Using two nested for loops, you could perform a search for the "best" stretch factor and time shift that result in the maximum correlation coefficient.

Label/Color Probability Plot Points by Group

I am plotting a data set consisting of the same kind of data from nominally the same source. I am using MATLAB's probplot command. I would like to do something along the lines of using findgroups to plot the points with a color corresponding to their source. I have attempted, for example,
probplot('lognormal', data, ~findgroups(category))
I am not sure how (or if) one could use the 'params' functionality to pass the findgroups and make this work. I'm interested in any other solutions as well.

k-means algorithm for energy data against time and date

I am using Matlab 2015a.
I have got electricity consumption data to cluster it. Initially i am trying to cluster it against hours and dates. I have created three different variables, one for time, one for dates and third for data. I am unable to understand how should i combine these in a matrix form so that the loads are distributed according to time? Then i have tried to look how can i plot a line graph for k-means but i can only find scatter command graphs but no line plots.
Further how can i plot it as a 3-d plot?
Further at a later stage i want to include temperature variable aswel. But when the 4th variable is involved, what will the plot be? will it still be 3-d?
Any suggestions, links?
In Matlab you can create N-dimensional matrices, so you can arrange your 3D data in a N*M*3 matrix (you might want to look for the cat() function to help you out).
There are several functions that allow you to plot in 3D, one of these is scatter3() which is perfect for K-Means clustering. I don't really understand which lines you do want to plot: K-Means is about clusters and centroids (i.e. points).
If a 4th variable is involved, you can as well create a 4D matrix. Although I reckon plotting a 4D graph isn't going to be easy. A first approach might be using several colours for your scatter points with different colours for different temperatures (or temperatures range). In this case the 5th input argument for scatter3() will be helpful.
Help for scatter3() here.
Help for cat() here.

How to give label for cluster from GMM iteration?

I read the concept of GMM from Understanding concept of Gaussian Mixture Models. It is helpful for me. I have implemented GMM for fisheriris also but I didn't use fitgmdist function because I didn't have it. So I used code from http://chrisjmccormick.wordpress.com/2014/08/04/gaussian-mixture-models-tutorial-and-matlab-code/.
When I read Understanding concept of Gaussian Mixture Models, Amro could plot the result with its label, i.e. setosa, virginica, and versicolor. How did he do it? After some iterations, I only got mu, Sigma, and weight. There is no label at all. I want to put the label (setosa, virginica, and versicolor) to mixture models from GMM iteration.
There are two sets of "labels" in that plot:
one is the "true" labels of the Fisher Iris dataset (the species variable which contains the class of each instance: setoas, versicolor, or virginica). Normally you wouldn't have those in a real dataset (after all the goal of clustering is to discover those groups within the data, which you don't know beforehand). I just used them here to get an idea of how well the EM clustering performed against the actual truth (the scatter points are color-coded according to the class).
the other set of labels are the clusters we found using GMM. Basically I built a 50x50 grid of 2D points to cover the entire data domain, I then assign a cluster to each of those points by computing the posterior probability and choosing the component with highest likelihood. I showed those clusters in the background color. As a nice consequence, we get to see the discriminant decision boundaries between the clusters.
You can see that the cluster of points on the left got separated quite nicely (and perfectly matched the setosa class). While the points on the right side of the plot got separated in two matching the other two classes, although there were instance "misclassified" if you will (some green points on the wrong side of the boundary).
Typically in a real setting you wouldn't have those actual classes to compare against, so no way to tell how "accurate" your clustering was (there exist other metrics for clustering performance evaluation)...