MATLAB Answers

Simbiology createSimFunction data access

2 views (last 30 days)
I am using createSimFunction to run many scenarios. The results come out in an array of simData. How can I efficiently access one of the output observables (e.g. species of interest) from each of the simData results to plot the ranges or confidence intervals from these many scenarios?

Accepted Answer

Jeremy Huard
Jeremy Huard on 21 Apr 2021
Edited: Jeremy Huard on 22 Apr 2021
Hi Mohammad,
the method selectbyname allows you to extract the data of a specific state.
Alternatively, you can use the attached function to generate a percentile plot for one of more states of your simData array:
sbioplotscan(simdataObj,"Name",["Receptor","Complex"],"Alpha",0.05)
or starting R2021a
sbioplotscan(simdataObj,Name=["Receptor","Complex"],Alpha=0.05)
For Alpha=0.05, the plot will display the median as well as a an area between the 2.5 and 97.5 percentiles.
Disclaimer: This function is a helper function I wrote for my personal use. It has not been thoroughly tested and is provided as is.
I hope this helps.
Best,
Jérémy
  8 Comments
Jeremy Huard
Jeremy Huard on 22 Apr 2021
Hi Mohammad,
I see what you mean now. You are right, DataNames are not necessarily unique. However, the DataInfo property contains information about the compartment that contains about the species. In my original code, I was only looking in DataNames. I have now updated the function and uploaded the updated version in my original answer.
Best,
Jérémy

Sign in to comment.

More Answers (0)

Communities

More Answers in the  SimBiology Community

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!