Applying a function to the values in a table
古いコメントを表示
I have this function where standard_time and E are part of a table. I want to create a new column from this function as such.
T.solar_time = calc_solar_time(T.standard_time, L_st, L_loc, T.E);
function solar_time = calc_solar_time(standard_time, L_st, L_loc, E)
if standard_time == 0
solar_time = 24 * 60 + 4 * (L_st - L_loc) + E;
else
solar_time = 4 * (L_st - L_loc) + E;
end
end
The function acts as if its written like below. As in it just uses the solar_time definition which it reaches the first time.
function solar_time = calc_solar_time(standard_time, L_st, L_loc, E)
solar_time = 4 * (L_st - L_loc) + E;
end
L_st and L_loc are constants.
The table is like this.. https://www.hizliresim.com/6amb7qx
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Trigonometry についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!