I´m wondering how to get these in Matlab:
a =
1 3
2 4
3 5
4 6
5 7
6 8
7 9
8 10
9 11
10 12
Really the structure I want to do has 2 thousand files. but I will start with something easier.
So I was thinking about to do it throught a loop:
for i=1:1:10
a(i) = [i i+2]
end
but this give an error:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
The idea is to generate a entire matrix (or structure, I suppose both are the same…) using a for loop (or may be there is a way to do it without any case of loop…).
Does anyone could tell me how to do it?
Thank you so much!
In your
forloop, you are assigning two numbers to one element of your array a. Tryinstead. Or, just use
which replaces your loop…