removing some the elements in cell array
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
data_array =
  1×5 cell array
  Columns 1 through 9
    {5×1 cell}    {5×1 cell}    {5×1 cell}    {5×1 cell}    {5×1 cell}    
    data_array{1,1}
ans =
  5×1 cell array
    {'PG02'}
    {'PG02'}
    {'PG02'}
    {'PG02'}
    {'PG02'}
The other cell arrays are similiar form. I need to remove first 3 (or last 3) cell elements from each sub cell arrays ({5×1 cell}). Then, the results will be :
data_array =
  1×5 cell array
  Columns 1 through 9
    {2×1 cell}    {2×1 cell}    {2×1 cell}    {2×1 cell}    {2×1 cell}
    data_array{1,1}
ans =
  5×1 cell array
    {'PG02'}
    {'PG02'}
My Matlab version is R2019a.
0 Commenti
Risposta accettata
  Jan
      
      
 il 19 Set 2021
        for k = 1:nunel(data_array)
   data_array{k} = data_array{k}(4:5);
   %         or  = data_array{k}(4:end);
   % Or:
   % data_array{k}(1:3) = [];
end
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Language Fundamentals in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

