This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = pwd; | |
directories = dir(root); | |
directories(ismember( {directories.name}, {'.', '..'})) = []; | |
directories = directories([directories.isdir]); | |
for k=1 : length(directories) | |
outputdir = [root filesep directories(k).name]; | |
files = dir(outputdir); | |
filename_idx = find(not(cellfun('isempty',strfind({files.name}, 'tif')))); | |
filename = files(filename_idx).name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Use databinner function on all variables in workspace. | |
for i=1:numel(vars) | |
eval(['[' vars{i} '_avg_2, ' vars{i} '_max_2] = dataBinner(' vars{i} ',2);']) | |
eval(['[' vars{i} '_avg_5, ' vars{i} '_max_5] = dataBinner(' vars{i} ',5);']) | |
eval(['[' vars{i} '_avg_10, ' vars{i} '_max_10] = dataBinner(' vars{i} ',10);']) | |
end | |
% Generate tables for allowing export of data back to prism. This pads tables | |
% for use with 30-wide columns in Prism. | |
for i=[2 5 10] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Load condition data and then run analysis for files in directory. | |
% Need to change "directory", Channels in loadConditionData and ChannelNames | |
directory = '/Users/exark/Desktop/Crops'; | |
dirs = dir(directory); | |
dirs = dirs(4:end); | |
dirs = dirs([dirs.isdir]); | |
data = repmat(struct('name',1,'data',1), 8, 1 ); | |
for i=1:length(dirs) | |
data(i).name = dirs(i).name; | |
data(i).data = loadConditionData([directory filesep dirs(i).name '/Treatment'], {'Ch1'}, {'alexa568'}, 'Parameters', [1.49 250 16e-6]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names = {} | |
x = hist(Lifetimes,[50 100 150 200 250 300 350 400]) | |
for i = 1:size(x) | |
x(:,i) = x(:,i)./sum(x(:,i)) | |
end | |
hist(Lifetimes,[50 100 150 200 250 300 350 400]) | |
legend(names) | |
bins = [50 100 150 200 250 300 350 400]; | |
figure() |