Let's consider the following script where I am creating a function such as y = f(x):
x = 0:0.01:2;
y = 0:0.02:4;
figure(1);clf;
plot(x, y);
Let's say I would now like to get some values of f such as f(0.5), f(1) or f(1.5). Is there any ways to get those values with a matlab function or do I have to first get the index of 0.5, 1 and 1.5 in x in order to get f(x)?