フィルターのクリア

dlmwrite Problem, text array,

6 ビュー (過去 30 日間)
Leila
Leila 2013 年 3 月 1 日
I have 2 questions:
1- I want to write 2 matrices in a .csv file,
dlmwrite('csvlist.csv', T) dlmwrite('csvlist.csv', A)
I can see only A in the 'csvlist.csv' ,How can I have both of the A and T in the final output?
2- I want to have a 96 by 1 matrix
_for i=1:1:96
A(i,1)={'+5m'} % text
end _
_dlmwrite('csvlist.csv', A, 'roffset',0,'coffset',0)_
It takes 3 columns , while it should be put on one column
Thank you

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 1 日
編集済み: Azzi Abdelmalek 2013 年 3 月 1 日
to add a matrix to a file use
dlmwrite(filename, T, '-append')
  2 件のコメント
Leila
Leila 2013 年 3 月 4 日
It was helpful But Azzi, When I type "dlmwrite(filename, T, '-append')" It doesn't copy T in the first row , It copies it the next row of previous matrice(row 97) ,while I need to have it in the second column and first row
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 4 日
Maybe you should use xlswrite?

サインインしてコメントする。

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 3 月 1 日
dlmwrite() is intended for numeric values. It is possible to use it for characters, but in order to do that, you need to convert everything in the cell array to character, use a '%s' as the 'precision', and set the 'delimiter' to be empty. Which implies that all the places you want the delimiter to appear between columns, you need to put it in as one of the characters.
On the whole it is usually easier to use fopen / fprintf / fclose than dlmwrite() for strings.

Leila
Leila 2013 年 3 月 4 日
Thank you Walter and AZzi, It was helpful But Azzi, When I type "dlmwrite(filename, T, '-append')" It doesn't copy T in the first row , It copies it the next row of previous matrice(row 97) ,while I need to have it in the second column and first row

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by