How to discretize variables related by a formula?

2 ビュー (過去 30 日間)
Edema Rhu
Edema Rhu 2018 年 5 月 7 日
コメント済み: Stephen23 2018 年 5 月 7 日
I am new at MatLab, so it would be much appreciated if you could keep it somewhat simple. So, I have a formula that relates two variables, let's say y = sin (x). How could I create a vector X that "holds" discrete values of x, let's say X = [1 2 3 4 ... ], and then apply this vector in the formula sin (x) and get a vector Y that "holds" discrete values of Y; in this example Y = [ sin (1) sin (2) sin (3) sin (4) ...]?
  1 件のコメント
Stephen23
Stephen23 2018 年 5 月 7 日
"I am new at MatLab, so it would be much appreciated if you could keep it somewhat simple."
Basic MATLAB concepts, such as how to define vectors of values and call functions on them, are explained in the introductory tutorials (which are highly recommended for all beginners):

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

回答 (1 件)

Torsten
Torsten 2018 年 5 月 7 日
n=10;
X=1:n;
Y=sin(X)
Best wishes
Torsten.

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by