I’m trying to create a vector of size 121×101 such that the ith column is made up of V_t*e, where V_t = 1000*10^((i-1)/20) and e is a 121 long column of ones.
Clearly i is to be varied from 1 to 101 million, but how would I apply that to a matrix without only yielding the final value in the results (applying this to every column without repeating commands)?
From your question, it looks like each row is the same. Thus, you can just calculate one row using REPMAT as
If you want to have
ebe 1 in row 1, 2 in row 2, etc, you can use NDGRID to create two arrays of the same size as the output, which contain the values ofeandifor every element(i,j)of the outputor you can use BSXFUN to do the expansion of
eandifor you