How do I remove a value from a column, but keep the rest?
조회 수: 7 (최근 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에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!