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.

 Réponse acceptée

Walter Roberson
Walter Roberson le 26 Mai 2022
Modifié(e) : Walter Roberson le 26 Mai 2022

13 commentaires

Behi
Behi le 27 Mai 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?
Which function did you use?
Behi
Behi le 27 Mai 2022
The second one-"3D colored line plot"
ok, how are you changing the line width?
Behi
Behi le 27 Mai 2022
Not with coding. Just by selecting the curve on the figure, then right click and choosing width.
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 le 27 Mai 2022
The part of the curve that has lighter colour disappears. Neither FaceAlpha nor LineWidth work.
Anyway, thank you so much for the answers.
Can you post code and data for us to test with?
Behi
Behi le 27 Mai 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.
If you were to create the final figure and savefig and attach the fig, we could test with that, without the code.
Behi
Behi le 28 Mai 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.
Google Drive?
Behi
Behi le 28 Mai 2022
Here you are:
https://drive.google.com/file/d/1R-S_XGaOPpwIGOLj1ZBC0x9Dw_SFTPYB/view?usp=sharing

Connectez-vous pour commenter.

Plus de réponses (1)

x = linspace(-1,1) ;
y = linspace(-1,1) ;
[X,Y] = meshgrid(x,y) ;
F = (Y-X)./(1+X.^2) ;
surf(X,Y,F)

1 commentaire

Behi
Behi le 26 Mai 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

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by