-
2 Comments
Vedatman Basu
on 25 Jul 2023
Can someone help explain what is happening here?
Christian Schröder
on 25 Jul 2023
@Vedatman it's basically the same as having
y = linspace(a, b, 5)
as the function body. regexp() is just used as a cheat to get the size of the solution down, using match-time code evaluation; see doc regexp, specifically the "Dynamic Regular Expressions" section.
Suggested Problems
-
Find the sum of all the numbers of the input vector
50438 Solvers
-
5505 Solvers
-
1490 Solvers
-
Matlab Basics II - Create a vector with a repeated entry
241 Solvers
-
Replace every 3rd element in a vector with 4
253 Solvers
More from this Author28
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!