Given a string S that defines an algebraic expression such as:
S= 'X= A1 + A2*(Y1 + A3*Y3)*exp( A4*Y12 + Y1) ;'
return a cell array {'Y1', 'Y12', 'Y123'}
i.e. parse the string S and identify the unique variables in the expression that start with the letter "Y".
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers60
Suggested Problems
-
How to find the position of an element in a vector without using the find function
2819 Solvers
-
Sum of first n terms of a harmonic progression
519 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
14137 Solvers
-
Cell Counting: How Many Draws?
2496 Solvers
-
Calculate the height of an object dropped from the sky
323 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think the correct example solution is {'Y1', 'Y12', 'Y3'}.