Convert Cells into matrixs

1 Ansicht (letzte 30 Tage)
Lucas Neves
Lucas Neves am 12 Apr. 2017
Kommentiert: Lucas Neves am 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!!

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by