LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generate graph in labview

Hi samatha.k,

what's the problem with it? You get only one point, because you write everytime to the same position. If you need a "curve" then you should connect the i terminal to y.

 

Hope it helps. 

Mike

0 Kudos
Message 11 of 14
(943 Views)

What you have done is take your x-axis and y-axis variables, and make them act as constants. Then you feed them into a for loop that says for i=0..99 create an element out of x-axis and y-axis (constants). So for example, if you set x-axis = 4 and y-axis = 8, you will create two arrays; each with 100 elements, one where every element = 4, and the other where every element = 8. If you plot (4,8) on graph paper 100 times, you will have single point (probably pretty smudgy) at (4,8). The way I used to graph things, I would create a table with an x and a y (or f(x)) where x would vary from -10 to 10 (or whatever), and y was a function of x, let's say y=x^2. To graph that in labview, take advantage of the i terminal in the for loop. i will increment by 1 for every iteration. if you want x to start from -10, then use i-10 and make the for loop iterate 21 times {-10, -9, .. , 0, 1, 2, .. , 10}. Inside the for loop, square each value of i-10. Think of this as a substitution where x = i-10, and y = (i-10)^2. It looks like this:

 

 

 

Chris

 

 

Message Edited by C. Minnella on 04-29-2009 10:07 AM
0 Kudos
Message 12 of 14
(933 Views)
thank u for the reply very nice of you anyways my problem is solved............:)
0 Kudos
Message 13 of 14
(912 Views)
thank you for the reply with your suggestion i was able to understand exactly how the for loop works and i was able to solve many issues with that really thank you very much........:)
0 Kudos
Message 14 of 14
(911 Views)