new STP project

This commit is contained in:
sonnenberg 2020-01-13 16:46:52 +01:00
parent 297c731166
commit 91fc8293c0
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,3 @@
ZIPFILES=
include ../project.mk

View File

@ -0,0 +1,34 @@
clear all
close all
data = load('Username_2019-05-22_001.mat');
IV_protnum = [25];
STP_protnum = [26, 27, 28, 29, 30];
IV = sortData(data, IV_protnum);
STP = sortData(data, STP_protnum);
IV_steps = -90:10:50;
save 'IV.mat' IV
save 'IV_steps.mat' IV_steps
save 'STP.mat' STP
% for i = 1:length(STP)
% for j = 1:length(STP{i})
% figure(j)
% hold on
% plot(STP{i}{j}(:,1),STP{i}{j}(:,2))
% hold off
% end
% end
%
% for i = 1:length(IV)
% for j = 1:length(IV{i})
% figure(j)
% hold on
% plot(IV{i}{j}(:,1),IV{i}{j}(:,2))
% hold off
% end
% end

View File

@ -0,0 +1,20 @@
function C = sortData(data, protnums)
names = fieldnames(data);
C = cell(1,length(protnums));
for i = 1:length(protnums)
idxvec = zeros(1,length(names));
for j = 1:length(names)
idxvec(j) = strcmp(names{j}(1:10), ['Trace_1_', num2str(protnums(i))]);
end
c = cell(1,sum(idxvec));
idxvec = find(idxvec);
for j = 1:length(idxvec)
c{j} = data.(names{idxvec(j)});
end
C{i} = c;
end