Plot the tidal ellipses for the four major tidal constituents
Show older comments
%% t_tide 이용하기
clc; clear all;
% 데이터 읽기
data = readtable('덕적도_실시간관측_조위.csv', 'TextType', 'string', 'Encoding', 'euc-kr', 'VariableNamingRule', 'preserve');
time = data.("관측시간"); % '관측시간' 열 이름을 정확히 입력하세요
elevation = data.("실측조위(Cm)");
% t_tide 함수를 사용하여 조석 분석 수행
[NAME, FREQ, TIDECON, ~] = t_tide(elevation, 'interval', 1/60, 'start time', datenum(time(1)), 'latitude', 35.58733);
% 주요 조석 성분 정보
major_constituents = {'M2', 'S2', 'K1', 'O1'};
colors = {'r', 'g', 'b', 'k'}; % 각각 빨강, 초록, 파랑, 검정
figure;
hold on;
for i = 1:length(major_constituents)
% 해당 조석 성분의 인덱스를 찾기
idx = find(strcmp(NAME, major_constituents{i}));
if ~isempty(idx)
% 타원 그리기 위해 필요한 매개변수 추출
major_axis = TIDECON(idx, 1); % 주축 길이
minor_axis = TIDECON(idx, 3); % 부축 길이
inclination = TIDECON(idx, 5) * pi / 180; % 도를 라디안으로 변환
x0 = 0; % 타원의 중심 x 좌표
y0 = 0; % 타원의 중심 y 좌표
% ellipsedraw 함수 호출
ellipsedraw(major_axis, minor_axis, x0, y0, inclination, colors{i});
end
end
xlabel('cm/s');
ylabel('cm/s');
title('Tidal Ellipses for Major Constituents');
legend(major_constituents);
grid on;
hold off;
.
I want to play Plot the temporal elipses for the four major temporal constructions, but nothing is coming out of the plot. Please help
Accepted Answer
More Answers (0)
Categories
Find more on Oceanography and Hydrology in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!