Colour code to find how big a function is

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.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 26 de Mayo de 2022
Editada: Walter Roberson el 26 de Mayo de 2022

13 comentarios

Behi
Behi el 27 de Mayo de 2022
Many thanks Walter, it works. Just one question, I wanted to make the line width bigger but when I did it, only some parts of curve become thick and the rest disapperar. would you mind telling me how can I do it?
Walter Roberson
Walter Roberson el 27 de Mayo de 2022
Which function did you use?
Behi
Behi el 27 de Mayo de 2022
The second one-"3D colored line plot"
Walter Roberson
Walter Roberson el 27 de Mayo de 2022
ok, how are you changing the line width?
Behi
Behi el 27 de Mayo de 2022
Not with coding. Just by selecting the curve on the figure, then right click and choosing width.
Walter Roberson
Walter Roberson el 27 de Mayo de 2022
Nothing is coming to mind at the moment.
Is the visible part the part that would be in front, and the part that disappears might be "behind" something? Does the part not shown change as you rotate the plot? If so then setting the surface FaceAlpha property might help.
Behi
Behi el 27 de Mayo de 2022
The part of the curve that has lighter colour disappears. Neither FaceAlpha nor LineWidth work.
Anyway, thank you so much for the answers.
Walter Roberson
Walter Roberson el 27 de Mayo de 2022
Can you post code and data for us to test with?
Behi
Behi el 27 de Mayo de 2022
I am afraid I can't...Actually, this is part of a project, and I don't have permission to post it here. If it were mine, it would be OK.
Walter Roberson
Walter Roberson el 28 de Mayo de 2022
If you were to create the final figure and savefig and attach the fig, we could test with that, without the code.
Behi
Behi el 28 de Mayo de 2022
I wanted to attach it, but its size exceeds 5 MB (15MB). I have also split it via zip; the file format is not supported.
I tried to make the width of another curve(simpler one) bigge by choosing the fcurve->right click->width and it works but for this curve the method that I used doesn't work.
Walter Roberson
Walter Roberson el 28 de Mayo de 2022
Google Drive?
Behi
Behi el 28 de Mayo de 2022
Here you are:
https://drive.google.com/file/d/1R-S_XGaOPpwIGOLj1ZBC0x9Dw_SFTPYB/view?usp=sharing

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 26 de Mayo de 2022
x = linspace(-1,1) ;
y = linspace(-1,1) ;
[X,Y] = meshgrid(x,y) ;
F = (Y-X)./(1+X.^2) ;
surf(X,Y,F)

1 comentario

Behi
Behi el 26 de Mayo de 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

Iniciar sesión para comentar.

Preguntada:

el 26 de Mayo de 2022

Comentada:

el 28 de Mayo de 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by