03-10-2011 03:14 AM
Hello, I'm Andi
I am a new comer from indonesia,
I try to study about labwindows for my task from lecture.
how to load/import data from file (ex:from notepad) and make from it become a matrix....
Thanks for the answer
Best regard.
Andi
03-10-2011 05:03 AM
Hi Andy
you have an example in CVI that takes a Waveform transfore it to a graph and then saving the data in file.
National Instruments\CVI2009\samples\fileio\arrayfile.cws
it will help you understand
Kobi
03-10-2011 05:52 AM
03-11-2011 07:36 PM
There are multiple ways to realize what you want to do.
One simple way is (1) use FileToArray(...) function to read all data into a 1-D arrary and (2) use a standard C loop to parse and rearrange the data into a 2-D array (matrix).
Please post your code so people can understand your problem better and help you.
03-12-2011 04:41 AM
Some more hints on this:
- FileToArray can directly generate a 2d array if you are starting from an ASCII file (which seems s your case: notepad)
- You need to know the number of rows/columns to dimension the array prior to calling FilToArray
- FileToArray cannot handle files with mixed text/numbers elements: if this is your case you will need to use some low level functions to open the file and scan it
If you can post a sample data file we can be more precise in our suggestions.