matlab字符串输出至.txt文件的问题

2025-01-27 13:33:57
推荐回答(1个)
回答1:

title = char('k','alpha_k','alpha_lower_k','alpha_upper_k','f_alpha_k');
fid = fopen('data.txt','w');
for i = 1:size(title, 1)
    fprintf(fid, '%s\n', title(i,:));
end
fclose(fid);