Hello, friends.
Today I will tell you another mathematical formula how to create a function in a lab.
For that purpose, I just go to my block diagram window over here.
As you see, this is my for loop.
I just set the loop count 50.
In this case, the number of x values you can set over here, you can control it also.
Right now, I just create a constant in this case.
As you see, this is my iteration loop.
Iteration.
It will start from zero to n minus one and just directly connect it to the edge of for loop and auto
indexing is on in this case.
As many as times.
My loop runs all the values stored at over here.
It will create an array.
As you see, the width of the wire is increased.
In this case.
So now I just explain you the function or formula.
The in the given VI.
So over here, let's say it is I iteration.
So when you multiply this iteration with three, it will give me three I.
So I just put three over here.
Then you just go here, this is my head function.
Just add before.
After this plus 0.1.
So over here, I'll just add.
Three plus 0.1.
After this operation and this function, this value goes to the sine function right now.
Sine is in radians.
So over here I just put sign of the given function.
After this, this value, the particular value that is value of sign function is multiplied by 0.8.
I just multiply it with 0.8.
Then it is multiplied with.
Minus one.
I just put.
Minus one over here.
As you see now, this value, this complete value is in X.
We just subtract minus one from it.
We just subtract one from it, not minus one.
So minus one.
So over here it is the complete formula.
So the value of I goes to this formula and value created by this function is stored at this particular
value.
For example, in I is zero, I is zero stored over here.
And when I is zero according to that function, the value goes over here.
So if you want to check what happened at every level, so just create.
Just go to Cobh.
And create.
Wires.
Second.
Third.
Or.
Fifth and final view.
Let's check what happened to it.
So in this case, initially, I just remove it.
Delete it.
So I just put a value zero, let's say, because initially when iteration is zero, I just put zero.
So when you hit on run button, you just get.
Zero into three, it will give me zero.
Then I just add 0.1.
So 0.1 is there.
At the third place over here, sine of 0.1 is 0.0998334.
At the next level, I just multiply 0.8 with it.
So value decreased.
0.079.
After this, I multiply minus one with it.
So value is minus one.
-0.0798667, and then just subtract minus one from it.
So I got this value and all these values are stored right now.
I just take an example of when I is zero in the next level, let's say one is there.
Then again, I hit on run button.
So again, the values initially it is one, two, three, three.
Then plus 0.1, it is 3.1.
Then it is sine of 3.1.
I got this value.
So likewise all the values respective to the iteration stored over here.
So I just delete this.
And connect this fire to.
Control be by this.
Connect this to location, as you see over here.
So now when you hit on run button.
Let's close this.
And you just check over here for the 50 values, not 50.
It is up to 49 because my loop count is 50, so n minus one.
My for loop goes from zero to n minus one.
So I got this pattern and this is the value of.
This function.
This function will give me the waveform graph of this.
Function over here.
I just use build array function.
It will connect, add this one and this one and it will create a two dimensional array, as you see
over here.
This is.
Two battle lines are there.
And over here I have a function transpose.
It will transpose the whole function and it will give me area over here.
In this case, I have total number of.
49.
Up to 49.
Total number of 50 values.
I just.
I just minimize it.
Using this, I'll just increase the.
Number over here.
Up to 49.
I just got the values in this case.
So as you see up to 49, when I just go one more increase, there is no value, as you see over here.
So this is the case how you can create.
Your own.
Eddie or your own.
Waveform graph using this function.
The given function you can change also your given function.
Let's say I want to go with only 30 values.
In that case, let's check what happened to it.
I think this.
So as you see, it is auto updated mode.
The function is an auto updated mode.
Graph is in auto operated mode.
That's why over here it is up to 29.
So this is how you can if you just change it to, let's say 100.
The fixed value is 100.
And over here, the mode.
A change changed?
So when you hit on run button.
Right now, this value is there and I just change it to control.
Just go to value over here.
I just put now 80.
So over here, as you got the function, this pattern is from the function.
This pattern is created by the function itself.
So this is how you can create your own function in LabVIEW and how to plot that function in LabVIEW.
Thank you.