matlab - String to Enumeration -


मेरे पास एक गणक है:

  classdef कमांड गुण कमांड स्ट्रिंग; सिफ़ पढ़िये; अंत विधियों obj = आदेश (commandString, readonly) obj.commandString = commandString; Obj.readonly = readonly;   

और मेरे पास एक स्ट्रिंग है:

  currentCommand = अंतराल की समाप्ति स्थितिमोड ('पी', गलत) ट्रैवलडीस्टन्स ('s', गलत) 'PositionMode';   

मैं वापस करने में सक्षम होना चाहता हूँ:

  कमांड.पोजीशनमोड   

क्या < / P> <पूर्व> विधियां (स्थिर) फ़ंक्शन obj = str2Command (स्ट्रिंग) obj = eval (['आदेश।' स्ट्रिंग]); संरचनाओं के साथ, आप वस्तुओं के साथ उपयोग कर सकते हैं।

  currentCommand = PositionMode   

कॉल

  आदेशों के साथ। (CurrentCommand)   

  आदेश   

के लिए मूल्यांकन करता है और इस प्रकार आपकी समस्या को एक सुरुचिपूर्ण और सुविधाजनक तरीके से हल करता है।

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -