Having trouble importing data from LABVIEW to MATLAB
8 次查看(过去 30 天)
显示 更早的评论
I'm attempting to import data from labview to MATLAB for analysis. I can't figure out which import function to use and I could use some help. I've attached the type of data that I will regularly come into contact with. The raw data leaves the software with absolutely no extension. On my computer, which has a windows 7 operating system, they denote the type of file extension as "File" and I think this may be the source of why I'm having so much trouble. The attachment to this forum post is a ".txt" file (entirely because this forum will not allow me to upload the file as it is originally), but this is not how they come to me in raw format. I had to modify the file by simply attaching ".txt" when renaming the file. All in all, if it is possible to import the data in it's raw file form (i.e. "File" form) and without attaching ".txt" to every file I am interested in, that would be the best possible scenario.
0 个评论
回答(1 个)
Star Strider
2016-1-20
I would use textscan:
fidi = fopen('Nicholas Frank 402-149 AD102-005rerun.txt','r');
Data = textscan(fidi, '%s%s%f%f', 'HeaderLines',6, 'Delimiter','\t', 'CollectOutput',1);
DateTimeC = Data{1};
DateTimeS = [char(DateTimeC(:,1)), repmat(' ', size(DateTimeC,1), 1) char(DateTimeC(:,2))]; % Date & Time As Strings
DateTimeN = datenum(DateTimeS, 'mm/dd/yyyy HH:MM:SS PM'); % Date & Time As Date Numbers
Sig_Temp = Data{2}; % Signal & Temperature Matrix
6 个评论
Walter Roberson
2016-1-21
We are not qualified to answer questions about Octave here. Octave questions should be asked in the Octave forums.
Star Strider
2016-1-21
It’s safe to say that if I’d known it was an Octave question, so that my Answer (and effort behind it) turned out to be irrelevant, I’d not have bothered. I quite definitely have better uses for my time.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!