writeTable won't take my parameters

6 visualizaciones (últimos 30 días)
Laura Dillon
Laura Dillon el 21 de Ag. de 2019
Respondida: Star Strider el 21 de Ag. de 2019
titles={'the' 'hungry' 'dog'}
a=['22b' ; '22c' ; '22d']
b=['23d' ; '23e' ; '34f']
myData=table(a,b, 'VariableNames', titles);
writeTable(myData ,' 'myData.xlsx');
Error using table (line 255)
Wrong number of arguments.
Hi all, this is my code it won't run for some reason
Thanks

Respuestas (1)

Star Strider
Star Strider el 21 de Ag. de 2019
The error was with table, not writetable. You are not creating the table correctly.
Try this:
titles={'the' 'hungry' 'dog'}
a={'22b' ; '22c' ; '22d'}
b={'23d' ; '23e' ; '34f'}
myData = array2table([a, b]', 'VariableNames', titles)
producing:
myData =
2×3 table
the hungry dog
_____ ______ _____
'22b' '22c' '22d'
'23d' '23e' '34f'
that I assume is what you want.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by