Problem 2486. Get the variable value from a string and generate sum

Solution 505991

Submitted on 28 Sep 2014 by Alfonso Nieto-Castanon
  • Size: 15
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% x = 'A=10'; y = 'B=20' y_correct = 32; assert(isequal(your_fcn_name(x,y),y_correct))

y = B=20

2   Pass
%% x = 'A=2'; y = 'B=10' y_correct = 12; assert(isequal(your_fcn_name(x,y),y_correct))

y = B=10

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!