1

I am doing a matrix modeling project for a biology class using MATLAB. I set the matrix to all zeroes in a 3 by 100 matrix. ie. Pop_size = zeros(3, 100). How do i then input values to the first column of the matrix. I tried Pop_size(1:3, 1) = (100, 100, 100). It told me i have an error and that it is possibly due to unbalanced brackets. Any help is much appreciated!

4

1 回答 1

1

您需要使用方括号而不是括号来创建矩阵:

Pop_size(1:3, 1) = [100 100 100]
于 2013-04-04T17:18:53.667 回答