How can i append cell arrays

2 views (last 30 days)
shubham shubham
shubham shubham on 7 Dec 2019
Answered: Stephen23 on 7 Dec 2019
if i give input like this score ({{[8,2,10,8,7,9,1,12], [9,6], 41};
{[10,10,10,10,10,1,1,1,15], [10,10]};
{[0,0,5,10,0,0,11], [3,4], 26}}, 85,35)
I want to assign a value to the cell array if it doesn't have a value in the input i.e {[10,10,10,10,10,1,1,1,15], [10,10]}; - it is a 1*2 cell array and i want to input a value in it's 1*3 position.
I used s{2,3} = 45; but it doesn't assign the value to the subcell which is {[10,10,10,10,10,1,1,1,15], [10,10]} instead it appends a 3*3 matrix and assigns it to that.
How can I check and then append the sub cell?

Accepted Answer

Stephen23
Stephen23 on 7 Dec 2019
C{2}{3} = 45

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!