writeTable won't take my parameters
6 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Star Strider
on 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.
0 Comments
See Also
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!