VariableOfInterest='LR'; Column=strcmp(tobj(1).DataNames,VariableOfInterest); figure, for i=1:length(x) plot(t{i},x{i}(:,Column)./(x{i}(end,Column)),'Color',rand(3,1)) hold on end legendname={}; for i=1:length(x) legendname{end+1}= num2str(tobj(i).RunInfo.Variant.Content{1}{4}); end legend(legendname) title(['Effect of Varying ', tobj(1).RunInfo.Variant.Content{1}{2}]) xlabel('Time') ylabel('Normalized Amount') endpoints=[]; for i=1:length(x) endpoints(i)=(x{i}(end,Column)); end %% % Create SimBiology Model. m1 = sbiomodel('untitled'); % Add component(s) to SimBiology Model. c1 = addcompartment(m1, 'unnamed'); % Configure properties. set(m1, 'Name', 'start'); % Add component(s) to SimBiology Model. s1 = addspecies(c1, 'species_1'); % Rename component. rename(s1, 'Ligand'); % Configure properties. set(s1, 'InitialAmount', 0.0); % Add component(s) to SimBiology Model. s2 = addspecies(c1, 'species_1'); % Rename component. rename(s2, 'Receptor'); % Add component(s) to SimBiology Model. r1 = addreaction(m1, 'null -> null'); s3 = addspecies(c1, 'species_1'); % Rename component. rename(s3, 'LR'); % Configure properties. set(r1, 'Reaction', 'Receptor -> null'); set(r1, 'Reaction', 'Receptor -> null'); set(r1, 'Reaction', 'Receptor + Ligand -> null'); set(r1, 'Reaction', 'Receptor + Ligand -> null'); set(r1, 'Reaction', 'Receptor + Ligand -> LR'); set(r1, 'Reaction', 'Receptor + Ligand -> LR'); set(s2, 'InitialAmount', 1.0); set(s1, 'ConstantAmount', true); set(r1, 'Reversible', true); % Add kinetic law object to the reaction. k1 = addkineticlaw(r1, 'MassAction'); % Add component(s) to SimBiology Model. p1 = addparameter(k1, 'kfor', 1.0); % Configure properties. set(k1, 'ParameterVariableNames', {'kfor',''}); % Add component(s) to SimBiology Model. p2 = addparameter(k1, 'krev', 1.0); % Configure properties. set(k1, 'ParameterVariableNames', {'kfor','krev'}); % Initialize configset for analysis run. cs = getconfigset(m1, 'default'); % Initialize variant used by the scan. scanVariant = sbiovariant('scanVariant','Tag','scanVariant'); % Initialize output. data = []; % Run scan. for k1 = 1:length(endpoints) % Set the variant's content (this removes the Content that was there in the previous run.) set(scanVariant, 'Content', {'species', 'unnamed.LR', 'InitialAmount', endpoints(k1)}); % Simulate the model. temp = sbiosimulate(m1, cs, scanVariant); % Concatenate the output. if isempty(data) data = temp; else data = [data;temp]; %#ok end end %% Normalize=1; VariableOfInterest='LR'; Column=strcmp(tobj(1).DataNames,VariableOfInterest); figure, for i=1:length(data) if Normalize plot(data(i).Time,data(i).Data(:,Column)./max(data(i).Data(:,Column)),'Color',rand(3,1)) else plot(data(i).Time,data(i).Data(:,Column),'Color',rand(3,1)) end hold on end legendname={}; for i=1:length(x) legendname{end+1}= num2str(tobj(i).RunInfo.Variant.Content{1}{4}); end legend(legendname) title(['Effect of Varying ', tobj(1).RunInfo.Variant.Content{1}{2}]) xlabel('Time') ylabel('Normalized Amount') endpoints=[]; for i=1:length(x) endpoints(i)=(x{i}(end,Column)); end