Writing data to a file
조회 수: 2(최근 30일)
표시 이전 댓글
Millie Jones 2020년 3월 26일
댓글: Millie Jones 2020년 3월 28일
I'd like write 1 to 20 to a file, but not sure how I would go about finishing the code. I've attempted to use a for loop here and think this is the right approach as it does count from 1 to 20, but the end of my code looks like this...
And I'd like to remove the two ans, but have tried to put semi colons in different places to hide the ans and doesn't seem to work. Here is my (attempted) code:
for a = 1.0:1:20;
댓글 수: 0
Bhaskar R 2020년 3월 26일
fprintf(fileid, '%d\n', [1:20]');
댓글 수: 1
Find more on Low-Level File I/O 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!