필터 지우기
필터 지우기

b=regexpre​p(b,'^','.​^','all'); doesn't works.

조회 수: 2 (최근 30일)
Jonghun
Jonghun 2013년 7월 8일
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?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 7월 8일
편집: Andrei Bobrov 2013년 7월 8일
syms t;
a=t^3+t*t+t^2/t;
b = vectorize(a);
  댓글 수: 1
Jonghun
Jonghun 2013년 7월 8일
Thank You!!!!!!!!!!

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

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 7월 8일
b=regexprep(b,'\^','.\^')

Jan
Jan 2013년 7월 8일
STRREP is faster than REGEXPREP:
b = strrep(b, '^', '.^');

카테고리

Help CenterFile Exchange에서 Card games에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by