Exporting Data - VirtualPhotonics/Vts.Gui.Wpf GitHub Wiki

To plot exported Plot View data

The exported data is a text file with a header, then the X and Y values are the first two tab-delimited columns. To replot this text file, use the following MATLAB script code:

% this script replots the data that is exported from the Plot View
% input: saved text file, e.g. ROfRho.txt 
data=readtable('ROfRho.txt','Delimiter','\t','HeaderLines',6);
xValues=data{:,1};
yValues=data{:,2};
figure;
plot(xValues,yValues,'ro-');
axis([min(xValues) max(xValues), min(yValues) max(yValues)]);
xlabel('rho [mm]');
ylabel('Reflectance');

To plot exported Map View data

The exported data is a text file with the X values on the first line, the Y values on the second line and the Map files in row major format on the third line. To replot this text file, use the following MATLAB script code:

% this script replots the data that is exported from the Map View
% input: saved text file, e.g. FluenceOfRhoAndZ.txt
fid = fopen('FluenceOfRhoAndZ.txt');
xValues={};
line1 = strsplit(fgetl(fid));
xValues=str2double(line1(4:end-1)); % get rid of header and last null datapoint
line2=strsplit(fgetl(fid));
yValues=str2double(line2(4:end-1)); % get rid of header and last null datapoint
line3=strsplit(fgetl(fid));
mapValues=str2double(line3(4:end-1)); % get rid of header and last null datapoint
fclose(fid);
figure;
map2D=reshape(mapValues,size(xValues,2),size(yValues,2)); % rehydrate linear data
imagesc(xValues,yValues,log10(map2D'));
axis ij;
axis equal;
axis([min(xValues) max(xValues), min(yValues) max(yValues)]);
colormap('hot');
colorbar;
xlabel('x [mm]');
ylabel('z [mm]');