An instrument I work with produces *.picotd files that are specialized text files, but appear as executable when I export to my Mac. I am trying to get the data (2-d) from the executable .picotd file (after the header) so that I can make plots, do analyses, etc.
I can't find any resources on this extraction or conversion. Someone provided me a function that should supposedly extract the data, but it messes up the data as one whole column becomes zeroes. I don't mind avoiding this function if I can find a cleaner way of getting the data. I am not extremely experienced with matlab but can work through examples and such.
This is the function ("loadpico") that should ideally extract the data:
fid=fopen(name); % Load file
fos=fopen('temp.tmp','w');tline = fgetl(fid);tline = fgetl(fid);tline = fgetl(fid);tline = fgetl(fid);tline = fgetl(fid);while(not(feof(fid))) tline = fgetl(fid); fprintf(fos,'%s\n',tline);endfclose(fos);fclose(fid);
The software outputs hundreds of waveforms, each one being a .picotd file. I'm trying to load them all at once, so I can stack them and plot them to create 2-D and 3-D plots. The following is my initial attempt to do a single folder of waveforms:
addpath(genpath('filepath/folder));fnames=dir('*picotd');numfids = length(fnames)vals = cell(1, numfids);for k = 1:numfidsvals{k} = loadpico(fnames(k).name);end
I think this script had its own issues as when I plotted vals{1}, vals{2} etc, instead of a single line in each plot, there were two lines (one for the x-column, one for the y-column, which became all zeroes as I had mentioned before).
Any help is much appreciated.
Best Answer