フィルターのクリア

How can i update my vector in an algorithm

1 回表示 (過去 30 日間)
zahid
zahid 2015 年 8 月 11 日
回答済み: Torsten 2015 年 8 月 11 日
Hi everyone I am running a simulation in which i am facing the following problem
In a simulation, initially i have the vector a=[2;6;12;4;9;7;16].In the second run of my algorithm the vector is updated in such a way that element at fourth position is deleted and updated vector will be a=[2;6;12;9;7;16].In the third run suppose the element at second position is deleted and updated vector will be a=[2,12,9,7,16].The position of deleted element can vary but here i put the simple example for understanding purpose. Appreciate if anyone can help me to solve this problem
Thanks

採用された回答

Torsten
Torsten 2015 年 8 月 11 日
a=[2;6;12;4;9;7;16];
a(4)=[]; % fourth element of a is deleted
a(2)=[]; % second element of (new vector) a is deleted
Best wishes
Torsten.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTroubleshooting についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by