how can i write the result of an array to a txt file, or excel
I want to record the array S values ​​to a file
please help me
S = zeros(1,256);
for j = 1:256
S(j)= j ;
end
for i = 1 :256
j = floor(x(i)/gt*2^8);
if j==0
j=256;
end
t = 2^8 - i;
if t==0
t=256
end
%[S(j), S(t)] = swap(S(t), S(j));
j
t
a = S(j)
S(j)= S(t)
S(t) = a
end
for i = 1:256
disp(S(i));
end

4 件のコメント

Rik
Rik 2019 年 6 月 7 日
Have you read the doc for fprintf?
hang dong
hang dong 2019 年 6 月 7 日
I want it to export a separate file, not on the command screen
Stephan
Stephan 2019 年 6 月 7 日
fprintf.JPG
hang dong
hang dong 2019 年 6 月 7 日
Can you give me an example?

サインインしてコメントする。

 採用された回答

KSSV
KSSV 2019 年 6 月 7 日

1 投票

writetable(array2table(S),'test.xlsx')
Or
xlswrite('test.xlsx',S) ;

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2019 年 6 月 7 日

回答済み:

2019 年 6 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by