×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Dimension mismatch when trying to insert array into cell

Dimension mismatch when trying to insert array into cell

Dimension mismatch when trying to insert array into cell

(OP)
Hi I am trying to assign a vector into a cell of another vector

this is what I have so far:

Population = zeros(20,1);
A = ceil(8 * rand(10,1));
Population(1,1) = A

I get the following error:

CODE

Subscripted assignment dimension mismatch.

I am only trying to assign A to the cell with row 1 and col 1.  So I am not sure why I am getting a dimension mismatch?
  

RE: Dimension mismatch when trying to insert array into cell

The question is: why do you think you shouldn't get a dimenion mismatch?   

=====================================
(2B)+(2B)'  ?

RE: Dimension mismatch when trying to insert array into cell

In order to do what you want yo do, you have to use cell or structures array. You can't do that using normal double-arrays. Look the help for cell and structures.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources