Divide elements of one vector by another

Hi MATLAB People,
I have two 35x1 vectors A & B. how do I divide each individual element of A by its corresponding element in B into a new 35x1 vector C?

 採用された回答

Star Strider
Star Strider 2015 年 11 月 30 日

10 投票

Use the element-wise dot operator (./) division:
C = A./B
See Array v Matrix Operations for all the other wonderful things the dot operator can do.

6 件のコメント

Eoghan Daly
Eoghan Daly 2015 年 11 月 30 日
So Simple, Thank you
Star Strider
Star Strider 2015 年 12 月 1 日
My pleasure.
It’s not quite as simple as it might seem. MATLAB has become a large and complex language. It takes a while to learn it, and to learn how to search the documentation. That in part is what MATLAB Answers is useful for.
Manoj Kumar
Manoj Kumar 2019 年 4 月 27 日
Dhanyavaad
Star Strider
Star Strider 2019 年 4 月 27 日
What?
Dushyant Kumar
Dushyant Kumar 2019 年 7 月 13 日
He means thankx in Hindi language :-)
Daniel
Daniel 2024 年 3 月 21 日
simple but effective lol

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

質問済み:

2015 年 11 月 30 日

コメント済み:

2024 年 3 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by