how to remove uncertainty from data in order to plot it
11 views (last 30 days)
John D'Errico on 26 Feb 2022
Edited: John D'Errico on 26 Feb 2022
You could do something as simple as:
S = "2.19479E-8 ± 2.46286E-10";
substrs = split(S);
N = double(substrs(1))
That is, break up the string into pieces, using the space to indicate where the split occurs. Then grab the first of those pieces. There are certainly other more sophisticated ways, but simple is often good.
I might remind you that it is a bad idea to just forget about that uncertainty. So better could be to also extract that uncertainty in the same way. Now instead of using plot to display the results, you could use a tool like the errorbar plotting tools, to plot not only the central value, but display the upper and lower limits on those central values. This would be a far more valuable plot.