how to create table and export it to Excel?

I have few vectors at the same length that contains numbers. I want to export them to the Excel or Word. how i do it?

 Respuesta aceptada

Guillaume
Guillaume el 8 de Jun. de 2015
v1 = [1 2 3 4 5]; v2 = [6 7 8 9 10]; v3 = [11 12 13 14 15];
xlswrite('somefile.xlsx', [v1;v2;v3]);

Más respuestas (1)

Peter Perkins
Peter Perkins el 8 de Jun. de 2015
Alternatively,
>> v1 = [1 2 3 4 5]'; v2 = [6 7 8 9 10]'; v3 = [11 12 13 14 15]';
>> t = table(v1,v2,v3)
t =
v1 v2 v3
__ __ __
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
>> writetable(t,'somefile.xlsx');

6 comentarios

eran golden
eran golden el 10 de Jun. de 2015
is it possicle that "table" function doesn't exist in the version of 2011?
Guillaume
Guillaume el 10 de Jun. de 2015
Yes, it came with 2013b or 2014a
Ambati Sathvik
Ambati Sathvik el 2 de Jul. de 2020
You saved my day
Sohrab Morshedi
Sohrab Morshedi el 2 de Dic. de 2020
Thanks
Christofer Longa
Christofer Longa el 3 de Feb. de 2021
Thank you....very very much
Lukas Sokol
Lukas Sokol el 18 de Mzo. de 2021
much love

Iniciar sesión para comentar.

Etiquetas

Preguntada:

el 8 de Jun. de 2015

Comentada:

el 18 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by