You can create an array for h and then iterate usign for loop according to size of the array "h".
While storing the output of the for loop you can have two arrays as "t" and "v" which can be iterated over to store the results, instead of having different variables as ta,tb,tc and so on.
For example:
N = [1 2 3];
t = zeros(1,length(N));
v = zeros(1,length(N));
for n = 1 : length(N)
[t(n),v(n)] = val(N,n);
end
function [xyz,abc] = val(N,n)
xyz = N(n);
abc = N(n);
end