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".
I think the correct example solution is {'Y1', 'Y12', 'Y3'}.
Good exercise. Two comments: 1) test case 3 has unbalanced parentheses. 2) Instruction should say that your are expecting results to be returned in sorted order, rather than the order in which they appear in the expression.
Find the peak 3n+1 sequence value
791 Solvers
Least common multiple of many numbers
159 Solvers
265 Solvers
191 Solvers
204 Solvers