How To Delete an Element In a Vector That Is Also In a Cell Array?

So I have a cell array and in the array I have a vector. I would like to delete a specific value from the vector and I can't figure out how to do that without deleting the entire array. Here is my code for the array:
{'sin',{'0','2pi','pi/100'},['0','1','1','0']}
As you can see, I have a vector of 4 elements in the last cell and I want the third on gone. How would I do that?

Answers (1)

YourCell{end}(3) = [];

2 Comments

Thank you! Now, how would I loop through every row and delete the third element of the vector for ever row?
In the case where all of those third elements have the same number of entries:
T = mat2cell(YourCell(:,3));
newCell = [YourCell(:,[1 2]), num2cell(T(:,[1:2 4:end]), 2)];

Sign in to comment.

Categories

Asked:

on 22 Nov 2017

Commented:

on 22 Nov 2017

Community Treasure Hunt

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

Start Hunting!