b=regexprep(b,'^','.^','all'); doesn't works.
이전 댓글 표시
I want to replace ,/,^ to .,./,.^
my code:
syms t;
a='t^3+t*t+t^2/t';
b=a;
b=regexprep(b,'*','.*','all');
b=regexprep(b,'/','./','all');
b=regexprep(b,'^','.^','all');
Result I want:
a=t^3+t*t+t^2/t
b=t.^3+t.*t+t.^2./t
Real result:
a=t^3+t*t+t^2/t
b=t^3+t.*t+t^2./t
I think " b=regexprep(b,'^','.^','all');" doesn't works.
How can I fix this problem?
채택된 답변
추가 답변 (2개)
Azzi Abdelmalek
2013년 7월 8일
b=regexprep(b,'\^','.\^')
Jan
2013년 7월 8일
STRREP is faster than REGEXPREP:
b = strrep(b, '^', '.^');
카테고리
도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!