フィルターのクリア

how to loop it

1 回表示 (過去 30 日間)
Rizwana
Rizwana 2014 年 1 月 30 日
コメント済み: Jos (10584) 2014 年 1 月 30 日
I have two columns. Both columns reads 264 elements and lets call them x & y.
x= 264*1 % reads radius r
y =264*1 % reads angle theta
I want to multiply first element of x with 1st element of y & 2nt elemnt of x with 2nd elemnt of y. How to do it... I used this logic. Its not working... Please help me
for i = 1 :264
x_new = x(i) * cosd(y(i))
y_new = y(i) * sind(y(i))
end

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 30 日
編集済み: Azzi Abdelmalek 2014 年 1 月 30 日
Use the multiplication element by element .*
z=x.*y
x_new=x.*cosd(y)
y_new=y.*sind(y)
  1 件のコメント
Rizwana
Rizwana 2014 年 1 月 30 日
Thank You. Iam getting it now :)

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

その他の回答 (1 件)

Iain
Iain 2014 年 1 月 30 日
Change:
x_new = x(i) * cosd(y(i))
y_new = y(i) * sind(y(i))
to
x(i+1) = x(i) * cosd(y(i))
y(i+1) = y(i) * sind(y(i))
  1 件のコメント
Jos (10584)
Jos (10584) 2014 年 1 月 30 日
?????

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

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by