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?
Walter Roberson
Walter Roberson 2022 年 5 月 27 日
Which function did you use?
Behi
Behi 2022 年 5 月 27 日
The second one-"3D colored line plot"
Walter Roberson
Walter Roberson 2022 年 5 月 27 日
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.
Walter Roberson
Walter Roberson 2022 年 5 月 27 日
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.
Walter Roberson
Walter Roberson 2022 年 5 月 27 日
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.
Walter Roberson
Walter Roberson 2022 年 5 月 28 日
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.
Walter Roberson
Walter Roberson 2022 年 5 月 28 日
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 日

0 投票

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