It’s always best not to ‘overthink’ problems (and I admit that I’ve don that so often, I’ve lost count).
This works:
% Lorenz System
f = @(t,x) [10*(x(2)-x(1)); -x(1).*x(3)+28 .* x(1)- x(2); x(1).*x(2)-8*x(3)/3];
y0=[1;2;3];
[t,y] = ode23(f,[0 100],y0);
figure(1)
plot3(y(:,1),y(:,2),y(:,3));
grid on
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174044/image.png)
Note: This is all your code, I just copy-pasted it to an anonymous function, and did a few edits.