フィルターのクリア

writing a data in notepad without overwriting it

1 回表示 (過去 30 日間)
Max
Max 2011 年 11 月 17 日
hi
lets assume there is a for loop
for i=1:1:10
csvwrite('num.dat',i)
end
when i open the num.dat file there is only the data 10 in it where as i am suppose to store 1,2,.....10 ..suggest me an efficient way for it .. if the text pads are complicated ones to write this array suggest me to write the datas in the xls sheet ..that too will be sufficient ....
  1 件のコメント
chengxuan yu
chengxuan yu 2011 年 11 月 17 日
I make your program a little change and it works.But I don't know if it is what you required!
for i=1:1:10
j(i)=i;
csvwrite('num.dat',j)
end

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

回答 (1 件)

Jan
Jan 2011 年 11 月 17 日
CSVWRITE does not append the new data, but overwrites the former values. Therefore you should use the complete vector as input:
csvwrite('num.dat', 1:10);

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by