How do I export four variables of different sizes to an excel, txt or csv file?
12 次查看(过去 30 天)
显示 更早的评论
Hello, I have four variables, which I want to save to either excel, txt or csv. Which file format doesn't matter, it only needs to be able to save this file in a database and load the data later on again. Of the four variables, three have a size of 1x1 double and one has a size of 10x2 double.
Is there a way to export this data to one file, maybe even with the variable name?
2 个评论
采纳的回答
Gouri Chennuru
2020-11-6
Hi Jannis,
As a workaround you can use the following code snippet as an example,
a = 1 % 1*1
b = 2 % 1*1
c = 3 % 1*1
d = randn(10,2) % 10 *2
e = {a b c d} % storing all the variables in a single cell
writecell(e,'filename.xls') % eexporting the data into excel
Hope this Helps!
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!