Convert arguments in a function call to string, as written
I'm writing a client for a web database that stores array like data, and I'd like to provide a proxy methods that can access data with a matlab array like indexing. Currently I do this by creating a struct with anonymous function member variables that take indeces as a string. For instance:
my_data.my_var('1:end') or my_data.my_var('2:3:22')
Ideally, I'd like to pass in a native range (getting rid of the single quotes), but I don't see how I can prevent the range from expanding before I can convert it to string inside the anonymous function body. Am I overlooking a way I can automatically convert the argument pass to a function directly into a string exactly as it was entered? Is the situation any better with a class method?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!