Currently MATLAB crashes on Macbooks running Sonoma right after openning. The problem is with xcode 15. Both of these macbooks will be great. But on heavy task (yeah with Matlab :)) consider 60-70degC on cpu and gpu. Fans still remains off thanks to Apple. You wont feel heat on your palm rest or keyboard and it will remain fast, cool and noiseless.
I would suggest air 15 inch with 16gb ram or a base model pro Matlab+simulink with take about 7gb on disk.