# Colour code to find how big a function is

9 views (last 30 days)
Behi on 26 May 2022
Commented: Behi on 28 May 2022

Hi, I have 3D orbit, I want to write a code that pick each points (particularly its x &y not z) on this orbit and then calculate a function
f= (y-x)/1+x^2 correspond to the points on orbit. After that I want color code for the surface for function. In fact, I have to use color code to see how big is the function as we go around the orbit.
I would appreciate if any one could help me.

Walter Roberson on 26 May 2022
Edited: Walter Roberson on 26 May 2022
Behi on 28 May 2022
Here you are:

KSSV on 26 May 2022
x = linspace(-1,1) ;
y = linspace(-1,1) ;
[X,Y] = meshgrid(x,y) ;
F = (Y-X)./(1+X.^2) ;
surf(X,Y,F)
Behi on 26 May 2022
Thanks for the answer, the point is that the 3D orbit that I have is not a circle or specific orbit (it is imported, and I don't have its function), and I want to know is there a way in Matlab that moves on the orbit and for each point on it, plot the suface which has the function f with colour code..I have also attached the orbit to see