fprintf to create a file / precisions

1 Ansicht (letzte 30 Tage)
Max Müller
Max Müller am 25 Jul. 2014
Beantwortet: dpb am 25 Jul. 2014
Hey Guys, this code is supposed to write Data into Test.dat-file.However, it doesn't work, cause signal is an Cell-Array containing strings.So can u pls help me and correct the code.
fprintf(fid,'%i\t%i\t%i\t%f\t%i\t%f\t%s\n',index,addr,amptotal0,amptotal,amp2,theta,signal)
And if u have some minuts.....the precisions... %f means float / %i menas integer but what does the t and the n mean ?

Akzeptierte Antwort

dpb
dpb am 25 Jul. 2014
A)
fmt='%i\t%i\t%i\t%f\t%i\t%f\t%s\n';
fprintf(fid,fmt,index,addr,amptotal0,amptotal,amp2,theta,char(signal))
B)

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by