how to convert a variable to string in matlab? -


this question has answer here:

i have structure array

some_struct_var=struct( 'filed1', filed1, 'filed2', filed2 ,...) 

i want create string

   str=['the struct variable name :' , some_struct_var] 

with name of structure variable in it. some_struct_var may vary , not fixed.

create function takes variable input , returns string equivalent of variable's name ouput so:

vartostr = @(x) inputname(1); structvarstring = vartostr(some_struct_var) str = ['the struct variable name :', structvarstring] 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -