Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dimension mismatch when trying to insert array into cell

Status
Not open for further replies.

akaballa

Computer
May 29, 2011
7
CA
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?
 
Replies continue below

Recommended for you

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

=====================================
(2B)+(2B)' ?
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top