MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply TodayGiven 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".

52 correct solutions
42 incorrect solutions

Last solution submitted on Mar 28, 2016

1 Comment

William
on 28 Mar 2016

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.

1 Comment