Hi,
But the output a set of Numeric and text string.
How can i save the output in a csv file? do i need to put all my output values of the code to a Matrix then use csvwrite() function?
Please always keep the help list cc'd on all replies (Reply All) so others can contribute to the help, and the convention of this mailing list is to bottom post, not top post (see
http://www.idallen.com/topposting.html, in Gmail you have to tap/click the three dots to show replies to be able to bottom post)
Anyway, csvwrite and dlmwrite only write numeric data, so they won't output text. But I do find it is the easiest way to save data. It would require reading the data, extracting just the numbers and putting them in an array, then saving that array with csvwrite. Note that you can use the 'append' option to put the CSV data after some text header rows if you write them to a file first. See an example here:
but If you want a mix of data and text within the file, you'll need to use the c-style functions to output formatted text, as I had linked below. You'll have to read in the data (if its not already in memory) extract the data you want to rearrange, then write a script to output the data in the format you want using fprintf, fputs, etc.
if you want a mix of text and data, you'll probably need to use something like the c-style file i/o to create formatted text strings for writing.