This question is closed. Reopen it to edit or answer.

Import connected cell values into an array

1 view (last 30 days)
Brendan Görres
Brendan Görres on 1 Oct 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
Hey guys,
I am trying to import certain data from a 1756x2 cell array "aParts" into a vector. The cell array contains element numbers in one column and the related label in the second column. The purpose is to store every element with the same label in one vector.
What I have already done is to create an array where the indices for example for the label "Cavity" are stored.
Now i would like to export every element (from "aParts" column 1) where "aCavla" is 1 into a new vector. How can I do that?
Here is the code I got so far
for idx = 1:ilEle %Create Matrix with Elements and related label
aParts{idx,1}= (aElements(idx));
aParts{idx,2}= (aName(idx));
ilEle is a the length of th cell array "aParts", so in this particular example it equals 1756.
Thanks in advance

Answers (0)


Community Treasure Hunt

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

Start Hunting!