Hi Giovanni,
I understand that you want to create a column vector which contains consecutive numbers, from 1 to every single element of A.
In this command "B=1:A", only the first element of A is considered.
You can try the following code snippet, to get the expected result
A=[2;4;3;5];
B=[];
for i=1:length(A)
B=vertcat(B,(1:A(i))');
end