in your test suite it seems odd that rpz('a','b','-') is interpreted as 'a-b' while rpz('a','b','/') is interpreted as 'b/a' (instead of 'a/b'). Same goes for rpz('a','b','%') which is interpreted as 'b%a' instead of 'a%b'. Last, your last test case rpn(z(1),'+',z(2),'*',z(1),z(3),'-',z(4),z(5),'%','*') is plain weird... it should probably read rpn(z(1),z(2),'+',z(1),'*',z(3),'-',z(4),z(5),'%','*') instead...
Thank you for your comments; I will update the description and fix last test case.
I will retire the last test case for the problem.
I have an rpn solver but it only accepts strings
surface of a spherical planet
Convert String to Morse Code
Back to basics 20 - singleton dimensions
Who am I ?
Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
Convert a cell-array of values to MATLAB source code
Quine : write a quine in MATLAB
All Humans are Created Equal - Pareto Equality
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office