07-10-2014 03:36 AM - edited 07-10-2014 03:36 AM
Hi,
I have generated a text file in labview with file I/O's. when i am trying to read it in matlab
the matlab is showing an error as
??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==> …Eôþô
Thanks.
07-10-2014 04:35 AM
It doesn't seem to be a normal text file, it involves some sort of formatting. Can you show the File write function that you have made?
07-10-2014 05:05 AM
07-10-2014 05:30 AM - edited 07-10-2014 05:43 AM
Hi,
This is not a binary file. I performed a real time demodulation(communication), converted the binary bits to ascii string characters and saved in a text file.
Okay, I have created a simple text file in labview and i tried to read in the matlab. the same error occurs.
dlmread('Test.txt');
??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==> kjfhe
what i found is that the labview saves in ASCII text but not in plain text.
Also I created a tab delimited Text file. the same error follows
??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 2) ==> :10:2
07-10-2014 06:36 AM - edited 07-10-2014 06:38 AM
sagar.vidhyam@yahoo.com wrote:
This is not a binary file. I performed a real time demodulation(communication), converted the binary bits to ascii string characters and saved in a text file.
Then your bits-to-ASCII conversion was wrong. Open Testfile1.txt and have a look: that's not an ASCII file.
Please post your code. We can't help you otherwise.
sagar.vidhyam@yahoo.com wrote:
what i found is that the labview saves in ASCII text but not in plain text.
What do you mean? ASCII text is plain text!
sagar.vidhyam@yahoo.com wrote:
Also I created a tab delimited Text file. the same error follows
??? Error using ==> dlmread at 145
Mismatch between file and format string.
Trouble reading number from file (row 1, field 2) ==> :10:2
That's not LabVIEW's problem.
MATLAB's dlmread only accepts numbers -- it won't accept timestamps like "4:10:27 PM" or alphabetic strings like "kjfhefghk..." (please see MATLAB's documentation)