Generation of a column with constants values that increases for different RANGE of row

1 回表示 (過去 30 日間)
Euan Muir
Euan Muir 2021 年 2 月 12 日
回答済み: darova 2021 年 2 月 13 日
Hi I need help to create a column that will increase in value by one, every 96 row until the value Y increases by 1. This need to be able to be repeated unti there are no more rows left to pull values from
X=Value
Y=X depends on
So for rows 1-96: X=1 Y=A
97-192: X=2 Y=A
...
...
34944-35040: X=365 Y=B
Resets X value to one once the Y value increases by 1, or the row value reaches 35040

採用された回答

darova
darova 2021 年 2 月 13 日
Use meshgrid
x = meshgrid(1:5,ones(4,1))
x(:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by