Dear Göran,
indeed, you can achieve this by modifying the piece of code contained in the scan plot.
Let's say that you want to plot the final value of Ttot. In this case your code would be:
[time, stateData] = selectbyname(simdata, 'Cell.Ttot');
out = stateData(end);
Now, in the more general case where you wish to plot its value at any given time point you will have to consider two things. Let's first define t as the time point you are interested in.
- SimBiology records simulation data at times chosen by the ODE solver according to solver options like tolerances, maxstep, etc... To make sure that data is recorded at time = t, you can specific output times that will include t. For example, if you want to simulate your model for 72 hours and plot Ttot at t=48 hours, you can first open the Simulation Settings in your scan task and then give the following code in OutputTimes in the Simulation settings:
Press enter and you will a list that includes time points between 0 and 72 hours with an interval of 1 hour, which includes 48 hours.
Note: Please note that in that case, the StopTime defined in the default simulation settings as well as in any task will be ignored and replaced by the last time point in the OutputTimes list. Also the live plot in that task will display the simulation results at those time points. In cases where the interval is chosen too large, some dynamics might not be recorded and displayed in the Live Plot, although they might have been captured correctly by the solver.
2. If your model contains dosing schedules and/or events that are triggered at time=t, your simulation data might include multiple data points at this time point. In this case you will need to know whether you wish to plot Ttot before or after that event.
For simplicity let's assume that there is no event/dose at time=t. In that case your code will be the following:
[time, stateData] = selectbyname(simdata, 'Cell.Ttot');
out = stateData(time==48);
This should produce the results you are looking for.
On a separate note since you mentioned that you are not very comfortable with using MATLAB command, I can highly recommend the free MATLAB OnRamp course. It is a 2 hour interactive course in the browser to learn the basics of the MATLAB programming language and get familiar with MATLAB in general. There are also more comprehensive trainings both online or onsite. I hope this helps.
Best,
Jérémy