Home How to assign a matrix to a cell of a cell array
Reply: 0

How to assign a matrix to a cell of a cell array

user587
1#
user587 Published in June 23, 2018, 2:29 am

I'm working on matlab and try to assign a matrix to one cell of a cell array. However, there was always something wrong. Here is the code:

    C = {};
    myMatrix = xlsread('myexcelfile');
    C{'ID', 'info'} = myMatrix;

Then matlab prompted that

"Expected one output from a curly brace or dot indexing expression, but there were 12 results."

But if I don't use 'ID' and 'Info' but use '1' and '2' instead, the matrix could be assigned successfully.

Could anyone help me? Thanks!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.333745 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO