- 17th Nov 2022
- 06:03 am
function M3_main_SSS_tt_with_detailed_comments
% M3 main function having no inputs and outputs
% making screen and memory clear before exection of solution code :
clc; clear all; warning off; close all;
d = xlsread('Data_PGOX50_enzyme.csv'); % importing the given input csv file
dd = d(5:end , :); % importing the cells data present in file
time = dd(:,1); % importing the time values column from file
% importing the data values columns (i.e. from 1 to 10) from file :
data1 = dd(:,2); data2 = dd(:,3); data3 = dd(:,4); data4 = dd(:,5);
data5 = dd(:,6); data6 = dd(:,7); data7 = dd(:,8); data8 = dd(:,9);
data9 = dd(:,10); data10 = dd(:,11);
% making a figure plot that will open on full size window when run :
figure('units','normalized','outerposition',[0 0 1 1])
for i=2:1:11 % creating loop for performing calucalations on data 1 to 10
t = time; % making x-axis variable i.e. t
y = dd(:,i); % making y-axis variable i.e. y
?lling algo for 'tangent line' & algo for 'fitted curve'
[idx,lx,ly, tt,yy] = M3_Algorithm_SSS_TT_with_detailed_comments(t,y);
% plotting each data curve in each plot in subplots
subplot(5,2,i-1) % making subplot of 5 rows and 2 columns
plot(t, y,'b-','LineWidth',2) % plotting actual data curve
temp = num2str(i-1); % temp made for put heading over each subplot
title(strcat('Data',temp)); % putting title heading over each subplot
ylabel('[P] (uM)'); % labelling y-axis qty over each subplot
hold on % holding plot inorder to place tangent marker, line & fitted curve
plot(t(idx), y(idx), '.r','MarkerSize',20) % plotting tangent marker
hold on % holding plot inorder to place tanget line & fitted curve
plot(lx,ly,'r-','LineWidth',2); % plotting tangent line
hold on % holding plot inorder to place fitted curve
plot(tt,yy,'k') % plotting fitted curve
hold off % stopping hold in each subplot
grid % showing grid lines on background each subplot figure
xlim([min(t) max(t)]); % x-axis plot tight
ylim([min(y) max(y)+(max(y)/10)]); % y-axis plot tight with extra 10% top
SSE(i-1) = sum(y - yy); ?lculating sse error (i.e. actual vs predicted)
if i-1 >= 9 % only giving x-label to the bottom two subplots
xlabel('time (sec)'); % labelling x-axis qty under last two plots
end
end
suptitle('Ten Concentration Curves With Tangent Lines'); % giving main title to the complete plot
SSE = abs(SSE) % displaying each data curve sse error values (i.e. total 10 sse values) on command window
vo = [0.025 0.049 0.099 0.176 0.329 0.563 0.874 1.192 1.361 1.603]; % the given initial values of v0s
vmax = 1.806; % given max v
conc = d(2,2:end); % importing substrate concentraion values from input csv file
figure % plotting graph of vo vs subs_conc
plot(conc,vo,'k-o','LineWidth',2,'MarkerEdgeColor','b'); % plotting with markers
title('Initial Velocities as a function of Substrate Concentration'); % title of plot
xlabel('[S] (uM)'); % labelling x-axis
ylabel('v0'); % labelling y-axis
grid on % showing grid on background of plot