フィルターのクリア

Crossing_points for LEO Satellite at the equator

3 ビュー (過去 30 日間)
root
root 2023 年 12 月 7 日
回答済み: Neelanshu 2023 年 12 月 18 日
This code should give equatorial crossing points. Seems to work but not complete. This is sample sateltite latitude and I want to get the coresspodning equatorial crossing points.
Any comments on this code?
Thank you
latitude = [10, -5, -2, 8, -12, 15, 0, -3, 7, -9];
equatorial_crossing_indices = find(sign(latitude(1:end-1)) ~= sign(latitude(2:end))) + 1;
% Plotting
figure;
plot(latitude);
hold on;
scatter(equatorial_crossing_indices, latitude(equatorial_crossing_indices), 'red');
ax = gca;
ax.YAxisLocation = 'origin';
ax.XAxisLocation = 'origin';
ax.XAxis.TickLabelFormat = '%g°';
ax.YAxis.TickLabelFormat = '%g°';
plot([1, numel(latitude)], [0, 0], 'color', 'black', 'linestyle', '--', 'label', 'Equator');
title('Latitude Data with Equatorial Crossings');
xlabel('X');
ylabel('Latitude');
legend();
hold off;

回答 (1 件)

Neelanshu
Neelanshu 2023 年 12 月 18 日
Hi root,
I understand from your query that you are seeking assistance in detecting equatorial crossing points of latitude data, particularly in edge cases where transitions involve one of the latitudes being 0.
To detect the transitions in the sign of consecutive array elements in the “latitude” array, you can use an element-wise logical "AND" to check if one of the elements is 0 and then compute the "equatorial_crossing_indices" array using the "find" function. The following code snippet demonstrates how to handle such cases:
latitude = [10, -5, -2, 8, -12, 15, 0, -3, 7, -9];
%handling edge cases where there is 0
equatorial_crossing_indices = find((sign(latitude(1:end-1)) == -1* sign(latitude(2:end))) & sign(latitude(1:end-1)) ~= 0) + 1;
Here is the output observed for the given “latitude” array:
Hope this helps,
Regards,
Neelanshu

カテゴリ

Help Center および File ExchangeCoordinate Transformations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by