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.

 채택된 답변

Walter Roberson
Walter Roberson 2022년 5월 26일
편집: Walter Roberson 2022년 5월 26일

0 개 추천

댓글 수: 13

Behi
Behi 2022년 5월 27일
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 2022년 5월 27일
The second one-"3D colored line plot"
ok, how are you changing the line width?
Behi
Behi 2022년 5월 27일
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 2022년 5월 27일
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 2022년 5월 27일
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 2022년 5월 28일
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 2022년 5월 28일
Here you are:
https://drive.google.com/file/d/1R-S_XGaOPpwIGOLj1ZBC0x9Dw_SFTPYB/view?usp=sharing

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2022년 5월 26일
x = linspace(-1,1) ;
y = linspace(-1,1) ;
[X,Y] = meshgrid(x,y) ;
F = (Y-X)./(1+X.^2) ;
surf(X,Y,F)

댓글 수: 1

Behi
Behi 2022년 5월 26일
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

댓글을 달려면 로그인하십시오.

카테고리

질문:

2022년 5월 26일

댓글:

2022년 5월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by