Hello, I try to make vector by value and index.
Please see my code.
Tk=(rand(1,k)*N0); % Tk is index of h, k is index number, N0 is maxmum index.
Tk=sort(Tk); Ck=randn(1,k); %Ck is value matched index of Tk.
h=zeros(1,N0); % h is vector with index of Tk and value of Ck.(the other index has all zero.)
Example)
Tk = 2.2, 5.4Ck = 44, 67h = 0 0 ...0 0 0 44 0 0 0 0 0 ...0 67 0 0 0 0...
Please explain me.
Best Answer