Unable to perform assignment because the left and right sides have a different number of elements in cell array
Show older comments
Hello everybody,
Currently I have a bidimensional cell array which size is 200 * 2. I'm trying to append an element to the last position in some moment of my program, but however I'm unable to do so because I have this error "Unable to perform assignment because the left and right sides have a different number of elements".
I'm trying to append the data with this command: app.quizImages(end + 1) = {app.currentImageId, app.currentImagePath};
Where app.quizImages is the cell array, app.currentImageId is a number and app.currentImagePath is a string.
When I display the cell array this is the content that i'm getting (I have not putted everything since the size is 200 * 2)
{[ 1]} {'1.jpg' }
{[ 2]} {'10.jpg' }
{[ 3]} {'11.jpg' }
{[ 4]} {'12.jpg' }
{[ 5]} {'120.jpg'}
{[ 6]} {'121.jpg'}
And when I display the content I want to append this is what I'm getting
{[64]} {'21.jpg'}
Do you see any error in what I'm doing? I don't understand what I'm doing wrong and I have tried to fix it a long time already
Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Whos 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!