mttGetItemList.m 612 B

12345678910111213141516171819202122
  1. function [items,item_values] = mttGetItemList(text)
  2. if isempty(text)
  3. items = [] ;
  4. item_values = [] ;
  5. else
  6. counter = 0 ;
  7. fetching_items = 1 ;
  8. while fetching_items
  9. counter = counter + 1 ;
  10. [next_item,text] = mttCutText(text,',') ;
  11. [item_name,item_value] = mttCutText(next_item,'=') ;
  12. items{counter} = item_name ;
  13. item_values{counter} = item_value ;
  14. if isempty(text)
  15. fetching_items = 0 ;
  16. end
  17. end
  18. end