How to generate data

14 ビュー (過去 30 日間)
Manish Kumar
Manish Kumar 2019 年 3 月 7 日
コメント済み: Jos (10584) 2019 年 3 月 7 日
Dear experts,
I need help to generate the data for the following situation.
I want to generate data for x in the range of 0 to 5 with the interval of 0.01. For each x there is y in the range of 0 to 3 in the interval of 0.01. After that I want to make two columns of x and y.
Kindly help.

採用された回答

KSSV
KSSV 2019 年 3 月 7 日
x = 0:0.01:5 ;
y = 0:0.01:3 ;
[X,Y] = meshgrid(x,y) ;
iwant = [X(:) Y(:)]

その他の回答 (1 件)

Jos (10584)
Jos (10584) 2019 年 3 月 7 日
I suggest you read parts of the starters manual and the help, and start exploring matlab :-)
help linspace
help colon
x = 1:2:5
f = 3/5
y = f .* x
  2 件のコメント
Manish Kumar
Manish Kumar 2019 年 3 月 7 日
I have used
x = [0:0.01:5]
to get x values but it is in a row, i want it in column. And how to get y value for each x that i obtained ?
Jos (10584)
Jos (10584) 2019 年 3 月 7 日
help reshape
help transpose
Is there a relationship between a value of x and a value of y, like a formula?

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

カテゴリ

Help Center および File ExchangeWaveform Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by