How to generate data

조회 수: 19 (최근 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 CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by