Symbolic Toolbox: "error using replace"

조회 수: 10 (최근 30일)
Henri
Henri 2025년 10월 29일
이동: Walter Roberson 2025년 10월 31일
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
Torsten
Torsten 2025년 10월 29일
편집: Torsten 2025년 10월 29일
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 2025년 10월 29일
편집: Walter Roberson 2025년 10월 29일
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')

댓글을 달려면 로그인하십시오.

답변 (1개)

Henri
Henri 2025년 10월 30일
이동: Walter Roberson 2025년 10월 31일
@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!

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

제품


릴리스

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by