I have 2 arrays
Position = {"ITC""VTC""KZT"};
Direction = [0.34 0.56 0.99]
I have a pass these values to a interpn function such a way it should pass as set of values, which means i should pass like Position = "ITC" and direction = 0.34 , during the next position = "VTC" and direction = 0.56 and the last one. how do i do that ?
so it seems you want to pass all of the first ones, process them, then all of the second ones, process them, etc., up until the end of the list. You can pass them by index. Recommend reading the following on how to work with arrays and subsets by indexing:
specifically to your question:
>> Position = {"ITC","VTC","KZT"}
Position =
{
[1,1] = ITC
[1,2] = VTC
[1,3] = KZT
}
>> Direction = [0.34 0.56 0.99]
Direction =
0.34000 0.56000 0.99000
>> Position(2)
ans =
{
[1,1] = VTC
}
>> class(Position(2))
ans = cell
>> Position{2}
ans = VTC
>> class(Position{2})
ans = char
>> Direction(2)
ans = 0.56000
working with a for loop (just printing them to the screen, you can do whatever you want with them):
>> for idx = 1:numel(Direction)
printf("%s %f\n",Position{idx},Direction(idx));
endfor
ITC 0.340000
VTC 0.560000
KZT 0.990000