Works fine here in 2025b Update 1. Can you copy/paste the entire error message (all of the red text) as in edit to your question or in a repsonse to this comment?
The usual MATLAB "replace" function seems to be shadowed by another function "replace" with the same name, but this shadowing function is not listed in your output from
which replace -all
Do you know of a function with name "replace.m" that you've created and that is saved somewhere on your MATLAB path ?
@Torsten Hopp indeed, another replace.m in my Matlab path, that's embarrassing having warned students about this kind of thing for the last 35 years... So, all sorted. Thank you all for your contributions!
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.