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일

0 개 추천

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

Aqeel Awan
Aqeel Awan 2021년 6월 30일
not working
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개)

카테고리

도움말 센터 및 File Exchange에서 Data Types에 대해 자세히 알아보기

질문:

2021년 6월 30일

댓글:

2021년 6월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by