How to write a file with strings and numbers
1 view (last 30 days)
I would like to write an output file with all the information of variables and strings of my input files and values.
FILENAME = 'ASDF.txt'
XVALUE = 123
YVALUE = 123
Reading in forums, I was able to create a matrix with strings and numbers, which is not quite what I would like...
Any help will be appreciated. Thanks!
dpb on 23 Jul 2013
If the names are known and fixed, it's simple enough to just write them literally. If, otoh, it's more general than that you can encapsulate the write in a function inside of which you can use
to retrieve the variable names of the calling argument(s) as strings that can then be written to the file.
doc inputname % for more details
Or, alternatively, use named structure fields where the names are dynamically created and hence known.