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 Exchange에서 File 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