Writing a txt file via matlab
Show older comments
Hello,
I want to write a txt file via matlab, with a '.tck' extension instead of txt
I have the following :
b =
'BKY' 'DIS' 'KIY'
Then
fileID = fopen('ko.tck','wt')
I do get a fileID.
Then I want to transfer the content of b to the file
fprintf(fileID,'%s\n',b)
I get the following error :
Error using fprintf
Function is not defined for 'cell' inputs.
Do you know how to get these strings in a list form in my .tck file?
Thank you
D
Answers (1)
Azzi Abdelmalek
on 24 Nov 2014
b={'BKY' 'DIS' 'KIY'}
fileID = fopen('ko.tck','wt')
fprintf(fileID,'%s\n',b{:})
fclose(fileID)
1 Comment
Davin
on 24 Nov 2014
Categories
Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!