Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Jonghun
Jonghun el 8 de Jul. de 2013
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?

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 8 de Jul. de 2013
Editada: Andrei Bobrov el 8 de Jul. de 2013
syms t;
a=t^3+t*t+t^2/t;
b = vectorize(a);

Más respuestas (2)

Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jul. de 2013
b=regexprep(b,'\^','.\^')

Jan
Jan el 8 de Jul. de 2013
STRREP is faster than REGEXPREP:
b = strrep(b, '^', '.^');

Categorías

Más información sobre Card games en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by