필터 지우기
필터 지우기

Create x and y vectors?

조회 수: 4 (최근 30일)
Tyler Bodnarik
Tyler Bodnarik 2020년 11월 18일
편집: Les Beckham 2020년 11월 18일
How can I build an x and y vector given x(1) = 1 and y (1) = 1 (first data points), dx and dy = 2, and number of rows(total number of y values) and number of columns(total number of x values)? These vectors will be used along with a matrix of data points to plot a graph.

채택된 답변

Les Beckham
Les Beckham 2020년 11월 18일
편집: Les Beckham 2020년 11월 18일
Try this:
delta = 2; % dx, dy increment
N = 10; % desired number of points
x = 1:delta:delta*N;
y = 1:delta:delta*N'; % transpose y so that it is a column vector

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by