09-21-2009 09:52 AM
Not the greastest title to post, but wasn't sure how else to describe it in a title,
So I have a problem. I want to run part of my vi, possibly multiple times as I modify the number of points in a set of data that I want to do a lienar regression. Then once I have settled on a the number of points I want to use, I want to take the slope and intercept from the linear fit and use that in the other part of the vi.
my problem is that I don't know how to approach this. I had thought of using case structures. But I wasn't sure if that was the most appropriate option and if it was hwo to approach it. So what I am really looking for here is some advice on how I should approach this.
I will give a bit more detail of the vi (I should note this is not my entire vi, I have truncated it to the relevant parts for this problem). So i have set of intensity data and I want to run an autocorrelation on it, which is what my autocorrelation vi does. Once I get the autocorrelation data I normalise it. What I then do is to the get the initial slope of the autocorrelation data. This is done in my slope intercept vi. At the moment I have got things wired so that I can see how the fit looks with the data. It is here that I will be changing the number of points that are to be fitted. This slope intercept data is then used to calculate an apparent diffusion coefficient. It is in this region that I want to be able to essentially split the program into two parts. The first part allows for an appropriate fitting procedure to the initial slope of the auto correlation and to thus yeild the apprirate values. the second part is to then take the slope and intercept values and use them to calculate the apparent diffusion coefficient; so here I want to be able to then tell the program to run with the slope and intercept data (like using a button or something).
I have included the vi's and an example of my intensity data in a zip file.
Any help would be appreciated.
Thanks
09-21-2009 10:50 AM
This sounds like a perfect application for a State Machine architecture.
Try searching for State Machine and going through a few examples.
In your case, you will have a state for:
- initialization
- calibration (setting the number of points in the set)
- data analysis (linear fit)
Post back if you are having trouble figuring out how to set this architecture up.
09-21-2009 12:11 PM
09-21-2009 12:22 PM
09-21-2009 12:36 PM
09-21-2009 12:57 PM
09-21-2009 10:45 PM - edited 09-21-2009 10:47 PM
09-22-2009 06:37 AM
09-22-2009 07:03 AM