How do I remove a value from a column, but keep the rest?
3 次查看(过去 30 天)
显示 更早的评论
How do I remove a value from a column but then keep the rest of the values? For instance, say I had a set of values in a table within column six going from top to bottom, but wanted to remove the first value at the top and then keep the rest. What is the proper way to execute that?
0 个评论
采纳的回答
Image Analyst
2023-1-28
Assuming you want to get rid of the entire first row of table "t", you could do
t = t(2:end, :); % Extract rows 2 onwards.
2 个评论
Image Analyst
2023-1-28
Try this:
YearMax = max(tabledata(2:end , 6)) % Look only at rows 2 and below
更多回答(1 个)
Arif Hoq
2023-1-28
Try this. If there is any issue, please upload your data.
load patients
T = table(LastName,Gender,Age,Height,Weight,Smoker,Systolic,Diastolic)
size(T)
T(1,:)=[]
size(T)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!