02-02-2020 01:09 PM
Hi guys,
Attached you can find my project.
Now i need to determine the angular coefficient of the linear fit of 60 elements of the array named "Sforzi tarati" and i have to put all these angular coefficient into an array.
On the Y axis i want to have "sforzi tarati" and on the X axis i want to have numbers like 0, 50, 100, 150, ...
for example:
step #1 angular coefficient of the linear fit of the elements from #0 to #59
step #2 angular coefficient of the linear fit of the element from #1 to #60
...
till the end of the array named "sforzi tarati".
someone can help me?
Thanks a lot
02-02-2020 02:05 PM
It is very difficult to understand what you want to do. It is also unclear what constitutes your data. You talk about 60 elements of an array, but then mention "the angular coefficients of a linear fit" to these elements. You didn't attach your data file, so we can't "guess" what you are trying to tell us.
Your VI shows that you don't know enough LabVIEW to do this yourself -- go spend more time with the Tutorials, ask your teacher for help, ask your classmates for help. Some points:
Bob Schor
02-02-2020 02:07 PM - edited 02-02-2020 02:08 PM
(This is a VI, not a project. The term "project" has a special meaning in LabVIEW)
You did not include the data file. It would be simpler to just have the data in a diagram constant.
Your code makes no sense whatsoever.
@Gquadro wrote:for example:
step #1 angular coefficient of the linear fit of the elements from #0 to #59
step #2 angular coefficient of the linear fit of the element from #1 to #60
You can use linear fit ptbypt with a sample length of 60. But I would strongly recommend to start with a few basic tutorials first. 😉
02-02-2020 02:34 PM
Hi guys,
i know that the .vi is not well organized but for now is ok, i have to complete a work in labview but i don't have a lot of time so i'm soo sorry of this disaster.
Please forget about the .vi attached previously; we have to start from the array called "sforzi tarati".
i try to explain better what i need to do:
i have to do the linear fit of the elements contained in the array called "sforzi tarati" but not simultaneously of the whole numbers in the array but 60 elements per time. for each linear fit i have to calculate the slope and save all these slope in a new array.
02-02-2020 02:43 PM - edited 02-02-2020 02:44 PM
@Gquadro wrote:
Please forget about the .vi attached previously; we have to start from the array called "sforzi tarati".
As mentioned, we don't have your data and we have no idea how the values are arranged in it.
As attached, the "Sforzi tarati" in your VI is an empty array. If you want it to contain data, run your VI until it contains data, then "right-click...data operations...make current value default". Save and attach it once more.
02-02-2020 02:53 PM
Here you
Thanks a lot
02-02-2020 02:58 PM
here you
02-02-2020 04:14 PM
(Please don't attach a new file with the same name. If it is a different file, it should have a different name to avoid confusion. Since the name already existed, chrome renamed the new file to "Test1 (1).vi".)
Your file only has one column. I assume this is Y. To make a linear fit, you need X and Y. Is X just the array index or does it start over with each subset?
What is the result you want? How many elements in the expected result? N? N-60? N/60? Something else?
02-02-2020 04:27 PM
02-02-2020 04:39 PM
Sorry for the mistake with the file.
As X you can use the index of the array.
At the end I want to obtain the slope of each linear fit made on 60 elements.
The first fit has to be done on the elements from #0 to #59
The second fit has to be done on the elements from #1 to #60
... And so on till reaching the bottom of the array (always considering 60 elements, no more, no less)
Your file only has one column. I assume this is Y. To make a linear fit, you need X and Y. Is X just the array index or does it start over with each subset?
I think that we should obtain something like n-60 elements