LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Graph and count words..

Hello
I have some questions about some tasks I'm working width. Can anybody please
help me to manage? I really would appreciate it.
I need to..

1 Count a special word in a text I have loaded down with help of file path
and Read Characters From File.vi? Is it right to use "Match Pattern" in this
case? I tried this, but didn't know how to count the number of times the
word was present in the text.

2 When I'm using a XY Graph to show the function y=x*x (x=a number between
0 -2) and also would like to get y=x shown as a dot in the same plot, what
do I do?
Further a marked line from the line made by function y=x*x to the dot y=x
should be ticker. Any suggestions?

I really would be happy if someone could help me with this.
Thank you in advance.


--
Merethe Nygård. e-mail; audnyga@online.no
0 Kudos
Message 1 of 3
(3,014 Views)
I have a suggestion for question #1. You are definitely on the right track. Simply use the Match Pattern VI, like you have been, but put it in a while loop. Have the loop iterate until the pattern is not matched (ie. offset output = -1). Also use the offset output and a shift register to make sure each iteration of a match attempt begins where the previous iteration left off. The code to illustrate this concept is attached in LabVIEW 6.1 format. (If you need another format let me know).

As an example I just created a text file which is the body of your post (question). I searched for the word " the " and it was correctly found 6 times. I will attach the text file and the VI. Good luck!
-scraggs99
Download All
0 Kudos
Message 2 of 3
(3,014 Views)
.... I also took a look at your second question and that is definitely something you can do as well. LabVIEW comes with a great example which shows how to have multiple plots on an XY Graph. I will make sure to attach it here in 6.1 format.

The basic idea is to create an array of clusters. Each cluster in the array will be one plot. So bundle together the X and Y arrays in one bundle, bundle X^2 and Y arrays in another, then build an array out of the two clusters and wire it to an XY Graph. The XY Graph will accept this data type and will properly handle the plots.

As far as the "marked line" and "ticker" go I don't really understand exactly what you want there...

Good luck!
-scraggs99
0 Kudos
Message 3 of 3
(3,014 Views)