Amir
Amir

Reputation: 1428

dlmwrite in a loop using cell type as the name

I would like to save my filenames by calling my cell names as:

 bench(1:15).applicationNames

in which they are like this:

ans = 

   'mvt'


ans = 

   'symm'

, etc.

Having tested all kinds of conversions (cellstr, char, sprintf), i can't seems to find the solution for saving my array as bellow in loop:

dlmwrite('result_<bench(a),applicationName>.csv'),[zz' sort(bench(a).norm)],',')

where each bench.application has a name on it as mentioned above.

Upvotes: 0

Views: 124

Answers (1)

MrAzzaman
MrAzzaman

Reputation: 4768

Use sprintf in place of your first string:

sprintf('result_%s.csv',bench(a).application{:})

Edit: fixed, as it was pointed out to me that bench.application was a cellstring.

Upvotes: 1

Related Questions