MATLAB Answers

Creating Matrix based on grouping of elements in cell array

7 views (last 30 days)
Chad
Chad on 15 Jun 2020
Answered: KALYAN ACHARJYA on 18 Aug 2020
Say I have a cell array where each cell describes a group of numbers. I want a matrix that describes these groups in a logical manner. Here is an example:
C = {[1 3], [2], [4 5 6]},
I want A = [0 0 1 0 0 0;0 0 0 0 0 0;1 0 0 0 0 0;0 0 0 0 1 1;0 0 0 1 0 1;0 0 0 1 1 0]
Thanks

  1 Comment

Chaitanya Mallela
Chaitanya Mallela on 18 Aug 2020
Can you demostrate the logical operation which you want to perform on cell array C ?

Sign in to comment.

Answers (1)

Tags

Community Treasure Hunt

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

Start Hunting!