Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
May 29, 2011
Messages
7
Location
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?
 
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