-
1 Comment
Parvinderkaur Sodhi
on 24 Jun 2021
We can simply use 'append'
function y = stringfirstandlast(x)
y = append(x(1),x(length(x)))
end
Suggested Problems
-
553 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
12000 Solvers
-
5506 Solvers
-
404 Solvers
-
6459 Solvers
More from this Author56
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!