please ho can get in matlab B

1 回表示 (過去 30 日間)
Jose Louis
Jose Louis 2016 年 7 月 14 日
コメント済み: Jose Louis 2016 年 7 月 15 日
please how can get in matlab value of B and how to write the equation B for example
w=1:1:360 how to get B =sin(w2)- sin(w1) for each time step
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 14 日
What are w2 and w1?
Jose Louis
Jose Louis 2016 年 7 月 14 日
w2 and w1 are the values w for each time step , for example, w= [1 2 3 4 .....360] w2=2 and w1=1 for next step w2=3 and w1=2 etc

サインインしてコメントする。

採用された回答

Jan
Jan 2016 年 7 月 14 日
Either as a loop:
for w = 1:359
B(w) = sind(w+1) - sind(w); % SIND instead of SIN?!
end
or vectorized:
B = sind(2:360) - sind(1:259);
or most efficient:
B = diff(sind(1:360))
  1 件のコメント
Jose Louis
Jose Louis 2016 年 7 月 15 日
thank you for your answer, I have one more question : w=15*(ts-12), w start from some value not from 1 to some value and the number of values 360 , how can make a loop from the first value of w to last value like this for w=15*(ts-12) B=diff(sind(1:365)) end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by