필터 지우기
필터 지우기

Create matrix with step of columns

조회 수: 1 (최근 30일)
Dmitry Timofeev
Dmitry Timofeev 2019년 12월 26일
댓글: Dmitry Timofeev 2019년 12월 27일
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?

채택된 답변

Walter Roberson
Walter Roberson 2019년 12월 26일
newV = (0:n-1).'*k + v;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by