Convert Cells into matrixs

4 visualizzazioni (ultimi 30 giorni)
Lucas Neves
Lucas Neves il 12 Apr 2017
Commentato: Lucas Neves il 14 Apr 2017
I have a 5x9 cell and i want to create a matrix with the valeus from this cells. The problem is that this cells have values like
1x100 2 1x100 4 5 6 7
1x100 2 1x100 4 5 6 7
1x100 2 1x100 4 5 6 7
1x100 2 1x100 4 5 6 7
1x100 2 1x100 4 5 6 7
I want the matrix to be:
'Last Value from 1x100' 2 'Last Value from 1x100' 4 5 6 7
'Last Value from 1x100' 2 'Last Value from 1x100' 4 5 6 7
'Last Value from 1x100' 2 'Last Value from 1x100' 4 5 6 7
'Last Value from 1x100' 2 'Last Value from 1x100' 4 5 6 7
'Last Value from 1x100' 2 'Last Value from 1x100' 4 5 6 7
Any ideas? Thanks!!

Risposta accettata

Walter Roberson
Walter Roberson il 12 Apr 2017
result = cellfun( @(V) V(end), YourCellArray )
  1 Commento
Lucas Neves
Lucas Neves il 14 Apr 2017
You sir, are a legend! Hahahaha Thank you!

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by