using the table function with empty variables
1 次查看(过去 30 天)
显示 更早的评论
I would like to use the table function to put all my variables into a table. Some of my variables are empty, [], and so the table function no longer works. Is there any way I can write a code that searches for all the empty variables in my workspace and fill these variables with NaN and then use a code with the table function afterwards?
I have tried using various options such as fillmissing, variables=who, isempty, etc to no avail. It may be because I don't know how exactly to tailor these codes to work the way I want them to.
2 个评论
Walter Roberson
2018-4-12
Yes, it is possible, but it is bad programming practice. You should be creating all of those variables inside one data structure and then processing the data structure.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!