Not entirely without worries. Though I guess you can probably do it, if you don't plan to do it for months.
There are different aspects to consider, the most important one for this particular notebook being that its cooling is rather insufficient for that purpose, so it will get hot (generally an issue with notebooks, they're not designed for that purpose).
If you google for e.g. "stress test", you will find that under high load the CPU reaches around 90-92°C (which is acceptable) and throttles down to 1.5GHz. The notebook itself reaches peak temperatures on the outside of 50-55°C. Which is, well, not that awesome.
If it has that temperature on the outside, then that necessarily means it has that temperature (and presumably another 3-5°C more) on the inside, too.
For some components (the CPU, notably) that's a total non-issue, but for other components, it's not so awesome if a long life is desired. So... yes, this may be a problem.
Other issues with very high loads over long time that one might in general have to consider is the cooler fan's lifetime (running at max speed all the time), and generally the CPU overheating (used to be an issue especially with cheapish cooling, but modern CPUs make this problem almost non-existent by throttling down accordingly).
Another issue for very high loads on laptops in general is the (usually cheap) power supply unit running somewhat on the upper end and croaking after short time. That shouldn't be an issue with this particular notebook since its PSU is designed to accomodate not just the CPU but also the GTX-1050Ti (which is idle during Matlab use), and if the specs are truthful should be at around 40% load only.
Also, even when operating within thermal limits, there is degradation which is proportional with use, although whether your CPU lives 35 years or 17 years probably makes no practical difference (since a capacitator on your motherboard will die long before that time anyway, or something else).