How can I make a matrix of 35,486 rows 1 column.

1 回表示 (過去 30 日間)
Zishan
Zishan 2014 年 6 月 25 日
コメント済み: Zishan 2014 年 6 月 26 日
Dear all, I want to make a matrix of 35,486 rows and single column, with first 358 row's element is equal to 1, next 359 elements is equal to 2, next 359 elements is equal to 3, next 358 elements is equal to 4 and so on. Value of elements reaches up-to 100 in last elements. Any one please tell me idea.
  8 件のコメント
Joseph Cheng
Joseph Cheng 2014 年 6 月 26 日
編集済み: Joseph Cheng 2014 年 6 月 26 日
isn't that was i gave you for X? the Spacings is what you determine. I suggested that since you do not have predetermined spacings the you can just concatenate them together.
Now reading it again with fuzzy eyesight are you asking how to generate the random segments? There has been a few recent posts about random number generation that all add up to a defined total. I forget the function or file exchange name but that function could/would generate 100 entries that add up to 35486, then go do what i did above and loop through those entries.
Zishan
Zishan 2014 年 6 月 26 日
dear, I am still unable to generate a matrix of my choice... :P

サインインしてコメントする。

採用された回答

Sean de Wolski
Sean de Wolski 2014 年 6 月 26 日
x = reshape(repmat(1:100,[358, 1]),[],1);
  1 件のコメント
Zishan
Zishan 2014 年 6 月 26 日
does not work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by