how I can delete value from an array?

조회 수: 1 (최근 30일)
Aqeel Awan
Aqeel Awan 2021년 6월 30일
댓글: Aqeel Awan 2021년 6월 30일
m=4;node_tk=2;node=[];a=0;
for i=1:m
a=a+1;
node(a,:)=i;
end
for i=1:m
if node_tk== node(i)
delete node(i);
end
end
display(node)
i want to delete node_tk value from an array..

채택된 답변

Matt J
Matt J 2021년 6월 30일
편집: Matt J 2021년 6월 30일
m=4;node_tk=2;
node=1:m,
node = 1×4
1 2 3 4
node(node_tk==node)=[]
node = 1×3
1 3 4
  댓글 수: 3
Matt J
Matt J 2021년 6월 30일
but I showed you that it does!
Aqeel Awan
Aqeel Awan 2021년 6월 30일
done .. thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by