Convert table and obtain column values
显示 更早的评论
Hello, I have this table

How can I first generate an array of string and numbers and then replace the '---' with NaN. Finally I would need to get the values of the Var4 and Var 7.
采纳的回答
更多回答(1 个)
Steven Lord
2019-9-18
0 个投票
Use ismissing to locate the missing values (you can tell ismissing what it should consider as a missing value) then use the logical array output to replace the missing values with whatever value you want.
The fact that you're changing the data type (potentially for some but not all of the values of a table variable) could complicate things a bit, but if that's the case show a larger sample of your table (maybe two or three rows that have a missing value and two or three that don't) and we may be able to help you determine how to handle that situation.
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!