Create x and y vectors?

20 ビュー (過去 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 Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by