Results for
I would tell myself to understand vectorization. MATLAB is designed for operating on whole arrays and matrices at once. This is often more efficient than using loops.

how can I do to get those informations?
Explore all the capabilities for Modeling Dynamic Systems while keeping them handy with this Cheat Sheet - Download Now.

Hi! I'm new to pk modeling and Matlab. Can someone guide me through how to conduct population pk modeling based on pk parameters from non-human primate studies? Much thanks!!!!
The title is resonably non-descript, but I can explain it easily:
Say I have an initial Emax model:
v = emax1*[G]^n1/(ec501^n1+[G]^n1)
And I want to place v inside of a second Emax model:
y = emax2*v^n2/(ex502^n2+v^n2)
Currently, I have the full function of v inside y, twice, it's very long and whilst I only need to get it correct once, for readability in the future I'd rather have it in form #2. I've played around with non-constant parameters but I need the steady state to be v, not the rate rule, and I haven't worked out how to make a parameter shift to a form like v, as an observation might.
Are there any recommended solutions or do I simply need to keep with having v fully expressed in y?
Thank you,
Dan
Hi All,
I'm currently attempting to implement a Hodgkin-Huxley-type model of membrane potential, ideally I would like a species that represents the membrane potential as its own distinct entity, so as the reference elsewhere. I've currently established a molarity-based work around but it would be great if I could set the units for the species as millivolt, but that throws an error.
Is there an established way to do this? I imagine I'm not the first person to be trying to model a voltage-gated ion channel!
Thank you for your help.
Here's a MATLAB class I wrote that leverages the MATLAB Central Interface for MATLAB toolbox, which in turn uses the publicy available Community API. Using this class, I've created a few Favorites that show me what's going on in MATLAB Central - without having to leave MATLAB 🙂
The class has a few convenient queries:
- Results for the last 7 days
- Results for the last 30 days
- Results for the current month
- Results for today
And supporting a bunch of different content scopes:
- All MATLAB Central
- MATLAB Answers
- Blogs
- Cody
- Contests
- File Exchange
- Exclude Answers content
The results are displayed in the command window (which worked best for me) and link to each post. Here's what that looks like for this command
>> CommunityFeed.thisMonth("app designer", CommunityFeed.Scope.ExcludeAnswers)

Let me know if you find this class useful and feel free to suggest changes.
Hello,
I've looked around and I haven't found anything obvious about this, but is it possible to link to species/reactions, graphically, in a non-mass transfer sense? I have areas in my model where it would conceptually make sense to be able to see that species or reactions are linked, but if I link them in the standard way it demands that it be involved in the stoichiometry.
Perhaps some kind of dotted line, or similar?
Thank you, best regards,
Dan
New Cheat Sheet Alert!
Level up your data organization and access skills in MATLAB with our latest cheat sheet! Download the full cheat sheet on MATLAB GitHub for Students here.

Hello all,
I've been trying to shift my workflow more towards simbiology, it has a lot of very interesting features and it makes sense to try and do everything in one place if it works well..! Part of my hesitancy into this was some bad experiences handling units in the past, though this was almost certainly all out of my own ignorance, relatedly:
Getting onto my question.
In this model I have a species traveling around the body via blow flow, think a basic PBPK model. My species are picomolarities, if everything is already in concentrations, why is it necessary to initially divide by the compartment volume? i.e. 1/Pancreas below.

If my model dealt in molar quantities this would make a lot of sense, the division would represent the transition to concentrations. This, however, now necessitates my parameters be in units of liter/minute, which is actually correct, but I'd like clarification on why it's correct, ha!
Perhaps this is more of a modelling question than a simbiology question, but if there are answers I'd love to hear them. Thanks!
Calling all students! New to MATLAB or need helpful resources? Check out our MATLAB GitHub for Students repository! Find MATLAB examples, videos, cheat sheets, and more!

Visit the repository here: MATLAB GitHub for Students
Imagine x is a large vector and you want the smallest 10 elements. How might you do it?

Hi All,
I'm attempting to put a set of simbiology global sensitivity analysis plots into my thesis and I'm running into some issues with the GSA plots. Firstly, the figures are very large, it would be quite beneficial to grab a set of the plots and arrange them myself, is there any documentation on how to mess around with the '1x1 Sobol' produced by sbiosobol? Or just GSA plots in general.
The second problem is that the results appear to be relative to the most sensitive parameter in that run. Is it recommended to have a resonably sensitive 'baseline' parameter in each run? I find it difficult to compare plots when a not so sensitive parameter is being recorded as near '1' for the whole run because it's being stacked against a set of very insensitive parameters. I.e. if i have multiple sets of GSAs due to a large model, how can I easily compare results? If I could do some single run through with every parameter that would be the ideal, I imagine, but then the default plot would be half a mile off the bottom of my screen, haha! Perhaps there is a solution to the first question that might help there?
Thank you for your help,
Dan
Thats the task:
Given a square cell array:
x = {'01', '56'; '234', '789'};
return a single character array:
y = '0123456789'
I wrote a code that passes Test 1 and 2 and one that passes Test 3 but I'm searching a condition so that the code for Test 3 runs when the cell array only contains letters and the one for Test 1 and 2 in every other case. Can somebody help me?
This is my code:
y = []
[a,b]=size(x)
%%TEST 3
delimiter=zeros(1,a)
delimiter(end)=1
delimiter=repmat(delimiter,1,b)
delimiter(end)=''
delimiter=string(delimiter)
y=[]
for i=1:a*b
y = string([y x(i)])
end
y=join(y,delimiter)
y=erase(y,'0')
y=regexprep(y,'1',' ')
%%TEST 1+2
for i=1:a*b
y = string([y x(i)])
y=join(y)
end
y=erase(y,' ' )
That's the question: Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them comprise sides of a right-angled triangle. Return true if they do, otherwise return false .
I wrote this code but it doesn't pass test 7. I don't really understand why it isn't working. Can somebody help me?
function flag = isTherePythagoreanTriple(a, b, c, d)
a2=a^2
b2=b^2
c2=c^2
d2=d^2
format shortG
if a2+b2==c2
flag=true
else if a2+b2==d2
flag=true
else if a2+c2==d2
flag=true
else if c2+b2==d2
flag=true
else flag=false
end
end
end
end
end
That's the question:
The file cars.mat contains a table named cars with variables Model, MPG, Horsepower, Weight, and Acceleration for several classic cars.
Load the MAT-file. Given an integer N, calculate the output variable mpg.
Output mpg should contain the MPG of the top N lightest cars (by Weight) in a column vector.
I wrote this code and the resulting column vector has the right values but it doesn't pass the tests. What's wrong?
function mpg = sort_cars(N)
load cars.mat
sorted=sortrows(cars,4)
mpg = sorted(1:N,2)
end
Hi all,
I've translated a model from another piece of software (monolix) into simbio programmatically to make use of your very easy global sensitivity analysis system.
It looks a little something like this, for a 'single' line example:
r1 = addreaction(model,'InsI -> InsP');
r1.ReactionRate = 'InsI*kip/vi'; %- is + panc
k1 = addkineticlaw(r1, 'Unknown');
Multiplied about 20 fold, as you can see I have included my volumes within the reaction rates myself (vi). The model functions perfectly and I have corrected the outputs at the end:
[time, x, names] = sbiosimulate(model,csObj,dObj1);
x(:,1) = x(:,1)/vi;
So that they are in concentration, as needed. However, when it comes to sensitivity analysis because I have corrected them post-model it is technically incorrect, it is analysing the absolute quantities. This is quite noticible in the sensitivity to the volumes.
Is there an easy fix to this, I've had to fight dimensionality with units in the past using simbio and I'd be great if there was some way of dividing a compartment output by a volume, for example. It is a functionality that exists in monolix, so I was hopeful it might here!
Thank you for your time.
EDIT:
I think I've worked it out, I had to refactor my model to operate in concentrations, just refitting it now. Now I should just be able to use unitless compartments.
I am trying to simulate model of blood lymphocyte count from a paper using Simbiology. The rate of in or out following circadian rythym is kp(t)=km + kb cos [(t-tpeak)*2pi/24] Where and how do I write the expression ? I dont think I can write in repeated assignment ?
I recently have found that I am no longer able to give my difficulty rating for questions on Cody after sucessfully completing a question. This is obviously not a big deal, I was just wondering if this was an issue on my end or if there was some change that I was not aware of.
The option to rate does not pop up after solving a problem, and the rating in general does not even show up anymore when answering questions (though it is visible from problem groups).
I am currently facing a compatibility issue when attempting to load a SimBiology model created in MATLAB 2021a into MATLAB 2023a. Specifically, the code capture functionality does not seem to be working.
If anyone has encountered a similar situation or has insights on how to capture the code for a SimBiology model created in an older version of MATLAB, I would greatly appreciate your guidance. Are there any alternative methods or specific steps that can be followed to ensure successful code capture?
Thank you in advance for your time and expertise.