MATLAB: How should I write a value such as “0.9 micromolar^-1.sec^-1” in the code
input
Okay, so my question is if I have a value such as 0.9 micromolar^-1.sec^-1. How should I enter this value in the code.
Which of these is the correct one?
v = 0.9e-6
or
v = 0.9e6
Best Answer
Matlab does not keep track of the unit. It's up to you to enter your value in the correct unit according to the calculation that use it.
So, to answer your question: it depends on what unit the following calculation expect. If the calculation expects the value in micromolar^-1 * sec^-1, then
v = 0.9
is correct. If your calculation expects molar^-1 * sec^-1, then
v = 0.9 / 1e-6
is correct. If it's expecting something else, then something else is correct.
If you explicitly supply a date, this will not happen. Thextickformat function was introduced in R2016b, so you might not have it, but you can change theXTickLabel property directly.
alltime=linspace(...
datetime(2018,2,24,21,0,0),...
datetime(2018,2,25,09,0,0),...
8640+1);
allHR=randi([50 100],8640,1);
figure(1),clf(1)
plot(alltime,allHR)
xtickformat('hh:mm:ss a')
Edit: changed time steps from 5 minutes to 5 seconds.
Best Answer