how to write an array to file

14 vues (au cours des 30 derniers jours)
hang dong
hang dong le 7 Juin 2019
Réponse apportée : KSSV le 7 Juin 2019
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 commentaires
Stephan
Stephan le 7 Juin 2019
fprintf.JPG
hang dong
hang dong le 7 Juin 2019
Can you give me an example?

Connectez-vous pour commenter.

Réponse acceptée

KSSV
KSSV le 7 Juin 2019
writetable(array2table(S),'test.xlsx')
Or
xlswrite('test.xlsx',S) ;

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by