I have a vector N
which has 21 elements
N=[3900000 5300000 7200000 9600000 12900000 17100000 23100000 ...
31400000 38600000 50200000 62900000 76000000 92000000 ...
105700000 122800000 131700000 150700000 179000000 205000000 ...
226500000 248700000];
I first need to construct another vector Nprin=(N_{i+1}-N_{i-1})/20
so this is how I construct it
Nprin=(N(3:end)-N(1:end-2))/20;
I now need to divide N
by Nprin
elementwise (let's call it y
) but N
has 21 elements while Nprin
has 19 elements so is this how I should evaluate y
?
y=Nprin./N(1:end-2);
or is there a way that allows me simply do the following?
y=Nprin./N