writeTable won't take my parameters

7 Ansichten (letzte 30 Tage)
Laura Dillon
Laura Dillon am 21 Aug. 2019
Beantwortet: Star Strider am 21 Aug. 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

Antworten (1)

Star Strider
Star Strider am 21 Aug. 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.

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by