How do you create a string from two strings by intersecting them char by char to form a new word using a loop?
Show older comments
str1 = 'Hello'
str2 = 'Canada'
strNew = 'CHaenlaldoa' %This is how the new word should look like.
Thank you in advance!
4 Comments
Walter Roberson
on 27 Oct 2018
This is obviously homework. What have you tried?
Alfred Ofosu
on 27 Oct 2018
Kevin Chng
on 27 Oct 2018
for i = [1:numel(str2)]
try to look at the link below:
Do you notice any problem with your for-loop?
Alfred Ofosu
on 27 Oct 2018
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!