how I can delete value from an array?

1 次查看(过去 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

更多回答(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