matlab - How to generate a matrix through a loop? -


I'm wondering how to get them into matlab:

  a = 1 3 2 4 3 5 4 6 5 7 6 8 7 9 10 10 11 10 12 The structure that I really want to do is 2 thousand files but I will start with something easy . So I was thinking about doing it through a loop:  
  i = 1: 1: 10a (i) = [ii + 2] end   

but it returns an error:

  ??? In an assignment A (I) = B, the number of elements of B and I will be the same.   

The idea is to use a loop for a whole matrix (or structure, I think both are ...) (or maybe it's without any kind of The way loop case ...) Can anyone tell me how to do this? Thanks a lot!

In your in the loop, you are specifying two of your array Numbers to an element a Try

  i = 1: 1: 10a (i, :) = [i i + 2] for; Instead use the end   

or, just use

  a = [(1:10) '(3:12)'];   

that changes your loop ...

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

ruby on rails - Convert a Activerecord result with has_one associations into a single hash per record -

javascript - Read complete data from stream from onMessage -