MATLAB: Could anyone help me to solve the issue

graph

I want to plot the graph with respect to the following code:
x=1:10
for x=1:10
y=log(x)
end
plot (x,y,'*')
When I run the code I am unable to get the correct result.
What I actually need is i want to plot the graph with respect to all values.
Could anyone please help me on it?

Best Answer

x=1:10 ;
y = zeros(size(x)) ;
for i=1:length(x)
y(i)=log(x(i)) ;
end
plot (x,y,'*')
No for loop needed
x = 1:10 ;
y = log(x) ;
plot(X,y,'-*')