Plotting planets in MATLAB

7 ビュー (過去 30 日間)
Danielle Curtin
Danielle Curtin 2019 年 11 月 18 日
編集済み: the cyclist 2019 年 11 月 18 日
How do I plot all the planets in relation to the sun; x,y,z for the sun would be 0,0,0. Venus is X = 7.690918093481298E+07; Y =-7.695356068929358E+07; Z =-5.494117392182905E+06. What would the others be?

回答 (1 件)

the cyclist
the cyclist 2019 年 11 月 18 日
編集済み: the cyclist 2019 年 11 月 18 日
You have given very little detail about how your data are stored. There are a few possible ways, depending on that.
% Pretend data for the planet & sun locations:
xyz = [0 0 0; rand(8,3)]; % Sorry, Pluto
% Plot them
figure
plot3(xyz(:,1),xyz(:,2),xyz(:,3),'.','MarkerSize',24)
You could also used scatter3 instead of plot3.

カテゴリ

Help Center および File ExchangeEarth and Planetary Science についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by