[Octave] Menulis Fungsi Cell Array ke File CSV


Berikut cara menampilkan cell array dalam file CSV dengan menambah nilai (append)

function writecellappend (myCell, filename)
	file_id = fopen(filename, 'a');
	for i=1:size(myCell,2)
		for j=1:size(myCell,1)
			if(j < size(myCell,1))
			fprintf(file_id,"%d,",myCell{j,i});
			else
			fprintf(file_id,"%d",myCell{j,i});
			endif
	endfor
		fprintf(file_id,"\n");
	endfor
	fclose(file_id);
endfunction
  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s