Code covered by the BSD License

# GraphScannerGUI

15 Feb 2011 (Updated 08 Mar 2011)

GraphScanner GUI program allows to extract data values from graphs.

calculation(x,y,data,xyScaleMatrix)
```function newCoordinates = calculation(x,y,data,xyScaleMatrix)
%CALCULATION function performs calculation on point(s) and maps them to
%correspond the real coordinate values.
pixelData = data(1:3,3:4);
realData = data(1:3,1:2);
xPixelInfo = diff(pixelData(1:2,1));
yPixelInfo = diff(pixelData(1:2:3,2));
xRealInfo = diff(realData(1:2,1));
yRealInfo = diff(realData(1:2:3,2));
newCoordinates = zeros(size([x,y]));
newCoordinates(:,1) = (x-pixelData(1,1))*1/xPixelInfo*xRealInfo+realData(1,1);
newCoordinates(:,2) = (y-pixelData(1,2))*1/yPixelInfo*yRealInfo+realData(1,2);
newCoordinates(:,1) = str2num(sprintf('%10.6e\n',newCoordinates(:,1)));
newCoordinates(:,2) = str2num(sprintf('%10.6e\n',newCoordinates(:,2)));
if xyScaleMatrix(1) == 2
xLogTick = 10.^(log10(realData(1,1)):log10(realData(2,1)));
log10(2:10)*xPixelInfo/(numel(xLogTick)-1)+pixelData(1,1)]';
row = row(diff([0;col]) == 1);
[r,c] = ind2sub([m,n],row);
newCoordinates(:,1) = str2num(sprintf('%10.6e\n',newCoordinates(:,1)));
end
if xyScaleMatrix(2) == 2
yLogTick = 10.^(log10(realData(1,2)):log10(realData(3,2)));
log10(2:10)*yPixelInfo/(numel(yLogTick)-1)+pixelData(1,2)]';
row = row(diff([0;col]) == 1);
[r,c] = ind2sub([m,n],row);