| Description |
class2str(this,data) Create a string [ 'this = data;' ]
This function creates a string containing Matlab code describing a variable. Works recursively, for any class type (char, struct, cell, array, objects, ...). First argument may be omitted, so that class2str(variable) will also work. String can then be exported into a file.
INPUT
this: string containing the name of the object to describe (optional)
data: any data set (struct, array, cell, char)
OUTPUT
str: string which contains a code to generate the data.
EXAMPLES:
str=class2str('this', struct('a',1,'b',{'a comment'},'c',{[]}) );
str=class2str(struct('a',1,'b',{'a comment'},'c',{[]}));
See also: mat2str, num2str, eval, sprintf
Part of: iFiles utilities (ILL library)
Author: E. Farhi <farhi@ill.fr>. June, 2007. |