Undefined function 'replace' for input arguments of type 'char'.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi, I try to make my program work, but I am struggeling a bit with this mistake. I want to cut off the ending of my file name, e.g. 'NACA_65-209.txt'. Unfortunately the following code is not answering anything. When I try to use e.g. 'strrep' instead my following program ends with errors.
Thank you!
function AirfoilName = get.AirfoilName(ObjectName)
%Replace the file extension by nothing, to receive the
%AirfoilName.
oldString = '.txt';
newString = strcat('');
AirfoilName = replace(ObjectName.FileName, oldString, newString);
end
댓글 수: 0
답변 (2개)
Abi Waqas
2018년 3월 7일
Hello Do you mind pasting the code of class? You have shown the method of the class may you are doing something wrong in the class
댓글 수: 0
Steven Lord
2018년 3월 7일
Which release of MATLAB are you using? I suspect you're using a release prior to release R2016b, which is when the documentation indicates the replace function was introduced.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!