Symbolic Toolbox: "error using replace"

10 visualizaciones (últimos 30 días)
Henri
Henri el 29 de Oct. de 2025
Movida: Walter Roberson el 31 de Oct. de 2025
In version 2025b:
syms a b c x
f = a*x^2+b*x+c
f = 
gives error message:
Error using replace
Too many input arguments
This used to work fine (at least up to version 2023a, I also noted the issue in version 2024b).
Any idea what's going wrong anyone?
  9 comentarios
Torsten
Torsten el 29 de Oct. de 2025
Editada: Torsten el 29 de Oct. de 2025
I'm confused.
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 ?
Walter Roberson
Walter Roberson el 29 de Oct. de 2025
Editada: Walter Roberson el 29 de Oct. de 2025
What shows up if you command
dbtype 'C:\Program Files\MATLAB\R2025b\toolbox\matlab\strfun\replace.m' 1:3
Also, try
which replace('ab','a','c')

Iniciar sesión para comentar.

Respuestas (1)

Henri
Henri el 30 de Oct. de 2025
Movida: Walter Roberson el 31 de Oct. de 2025
@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!

Productos


Versión

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by