Matlabs sum for $\displaystyle \sum_{n=1}^{10^5} \frac{1}{n}$ is actually quite spot on, it's not a fault of machine accuracy. The series is called the Harmonic series and is known to diverge very slowly. In fact, it behaves approximately like $\gamma + \ln n$ where $\gamma$ is the Euler-Mascheroni constant, about $0.57721.$ At $n=10^5$ we indeed expect about $0.57721 + 5\ln 10 \approx 12.0901.$
Matlab is also not saying anything incorrect for the original series, its results were just interpreted incorrectly (in a similar way to the previous example). The sum grows quite slowly. Consider if we order the sum like this: $$\sum_{m=1}^{\infty} \sum_{n=1}^{\infty} \frac{1}{m^2+n^2}.$$
By Residue Calculus methods, one can show that the inner sum is equal to $$ \frac{\pi m \coth(\pi m) -1}{2m^2}.$$
$\coth$ tends to $1$ exponentially quickly so one expects $$\sum_{m=1}^k \sum_{n=1}^{\infty} \frac{1}{m^2+n^2} \approx \frac{\pi \ln k}{2} + \frac{6\gamma \pi-\pi^2}{12}$$ for large $k.$