how to name a data file with a variable?

hi,
I have a matrix as follows
list =
[-3] [ 0] [ 0]
[-2] [-2] [-1]
[-2] [-2] [ 1]
[-2] [-1] [-2]
[-2] [-1] [ 2]
[-2] [ 1] [-2]
[-2] [ 1] [ 2]
[-2] [ 2] [-1]
[-2] [ 2] [ 1]
[-1] [-2] [-2]
[-1] [-2] [ 2]
[-1] [ 2] [-2]
[-1] [ 2] [ 2]
[ 0] [-3] [ 0]
[ 0] [ 0] [-3]
[ 0] [ 0] [ 3]
[ 0] [ 3] [ 0]
[ 1] [-2] [-2]
[ 1] [-2] [ 2]
[ 1] [ 2] [-2]
[ 1] [ 2] [ 2]
[ 2] [-2] [-1]
[ 2] [-2] [ 1]
[ 2] [-1] [-2]
[ 2] [-1] [ 2]
[ 2] [ 1] [-2]
[ 2] [ 1] [ 2]
[ 2] [ 2] [-1]
[ 2] [ 2] [ 1]
[ 3] [ 0] [ 0]
and i want to use the rows of this matrix as the name of my data files such as
data_qx<list{1,1}>_qy<list{1,2}>_qz<list{1,3}>.dat
how can i do so?

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 3 月 24 日
編集済み: Azzi Abdelmalek 2016 年 3 月 24 日

0 投票

q=[1 2 3]
sprintf('data_qx%d_qy%d_qz%d.dat',q)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

質問済み:

2016 年 3 月 24 日

編集済み:

2016 年 3 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by