Delete row from dataset array

4 ビュー (過去 30 日間)
Manuel
Manuel 2013 年 7 月 26 日
I have a dataset array of strings and doubles, and I would like to delete the first row(completly), I mean the 2nd row will pass to be the 1st and so on... for now I tried deleting the content but the row is still there and Im having indexing problems afterwards:
test{1,i}=[]; %%test is the dataset array and i the index to pass throught all cells
Thanks in advance,
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 26 日
Can you give a short example?
Manuel
Manuel 2013 年 7 月 26 日
Sorry to not give an example. If we have the array 'test':
test =
8 1 6
3 5 7
4 9 2
I would like to have a 'new_test':
new_test =
3 5 7
4 9 2
This means remove the first row content and increase one row up all the other content or if is possible remove directly the first row(then in this case the 2nd row would be the 1st one) im not sure if this second option is possible.
Thank you Azzi,

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 26 日

その他の回答 (1 件)

kjetil87
kjetil87 2013 年 7 月 26 日
test=cell(3,1);
test{1}='row1';
test{2}='row2';
test{3}='row3';
%remove a row:
test={test{2:end,:}}.';
  2 件のコメント
kjetil87
kjetil87 2013 年 7 月 26 日
if it is not a cell:
new_test=test(2:end,:);
Manuel
Manuel 2013 年 7 月 26 日
Thank you very much, it works!

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by