Convert Cells into matrixs

4 views (last 30 days)
Lucas Neves
Lucas Neves on 12 Apr 2017
Commented: Lucas Neves on 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!!

Accepted Answer

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

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!