Filter löschen
Filter löschen

Create matrix with step of columns

1 Ansicht (letzte 30 Tage)
Dmitry Timofeev
Dmitry Timofeev am 26 Dez. 2019
Kommentiert: Dmitry Timofeev am 27 Dez. 2019
clear; clc;
v = 1:257;
n = 10;
k = 7;
newV = (repmat(v, n, 1) + k) .* 2.^(0:(n-1))' - k;
Now I have a matrix with first column, for example if k=7, I have [1;9;25;57;121], but I need column [1;9;17;25;33;41].
How to do this?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 26 Dez. 2019
newV = (0:n-1).'*k + v;

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Identification finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by