LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read in ascii file which plots two data in one graph

Hi,
 
I want to plot two graphs into one graph. The VI should read in the ascii text file and then plot the data. I know how to plot only one graph but, I want to know how to plot multiple graphs into one xy axes graph. The data file is a 3 X 21 Array. The first row is the x values going from negative one to one with a 0.1 increment. The second row squares all the x values from the first row. So, if x is -0.9 then its square is 0.81. The third row does the same thing but, this time it takes the cube of the x values. So, if x is -0.9 then the cube of this value becomes -0.729. I have created a VI that would plot these values. When I run the VI, it only takes the first two rows and deletes the third row which is the cube of the x values. I will attach my VI, the text file, and the graph of how it suppose to look like. I have plotted the graph on matlab but, I want to use labview to do the samething. I also created a table so I can see what numbers are being fed in the read from spreadsheet file. The numbers are coming out correctly but, the last row is deleted from the array. Can someone help me here because I was working on this for a quite some time. Thanks.
 
Fidaali  
Download All
0 Kudos
Message 1 of 5
(2,836 Views)

The VI is one that I gave you. Please don't claim that you wrote anything yourself. The reason that column 5 is being deleted is because of the extra tab character you had in the data file in your original post and was explained over and over again. The Delete From Array needs to be removed and you have change the Index Array function to get the new rows in this file. Other than column 5, nothing at all is being deleted. The data is just not indexed out of the array.

You really should spend some time with the tutorials at http://www.ni.com/academic/lv_training/how_learn_lv.htm.

0 Kudos
Message 2 of 5
(2,828 Views)

I'm sorry. I shouldn't have said that I made it. But, can you help me with the process because I was working on this for a while now and there is no progress. Thanks.

Fidaali

0 Kudos
Message 3 of 5
(2,820 Views)
Do you know how I can change the Index Array to get the new rows in the file?
0 Kudos
Message 4 of 5
(2,812 Views)

Yes, I know how to change the Index Array function and if you would take the lessons I mentioned, you would too.

You also need to take advantage of the on-line help. If you do not have it turned on, go to Help>Show Context Help and make sure it is checked. The on-line help for the Index Array function is pretty clear on how it can be expanded, I think.

 

0 Kudos
Message 5 of 5
(2,788 Views)