04-08-2020 06:59 AM
1 make a for loop
2 make a formula node
3 write a code : (y1 = sin(x) , 0<x<11*pi ; y1 = 5*sin(x) , 0<x<21*pi)
for(x=0; x<11*pi; x=x+pi)
{
y1 = sin(x);
}
for(x=11*pi; x<21*pi;x=x+pi)
{
y1 = 5*sin(x);
}
4 connect with my graph
But the result is just one line on the graph , I don't know why ?
I put the file under the article. Who can help me?
04-08-2020 07:57 AM
You never use the variable "i" in the equation.
Your output is a single value of Y1 which is the final result when the Loops inside your mathscript node are done executing. Nothing about them changes, thus you not changing any results after you execute that whole assemble 100 times.
Why do you have loops within loops?
Why are you using the mathscript node?
This sounds like homework problem. Get rid of the mathscript node and use actual LabVIEW functions that are based on the i value of the For Loop.