Matlab help — How to replace a word using findstr?

  • MATLAB
  • Thread starter tdang
  • Start date
  • Tags
    Matlab
  • #1
tdang
1
0
TL;DR Summary
How to replace a word using findstr
Matlab help!
Hello
I want to create a sentence 2

sen1: I love flower
str1: love
str2: hate

How can I create sen2= "I hate flower" using findstr and array concatenation?
 
Physics news on Phys.org
  • #2
In any case, for reliable use in large documents, you should do something to only replace whole words and to match regardless of capitalization. I am sure that MATLAB has some regular expressions to allow that.
 
  • #3
There is an extrensive documentation from Matlab on strings here which should cover everything you need. Take a look at strrep for example.
 
  • Like
Likes FactChecker

Similar threads

Replies
4
Views
3K
Replies
5
Views
1K
Replies
2
Views
3K
Replies
11
Views
3K
Replies
0
Views
2K
Replies
4
Views
3K
Replies
5
Views
3K
Back
Top