Generating a matrix

조회 수: 9 (최근 30일)
kash
kash 2012년 2월 13일
I want to generate a matrix as
first column must consist values of =.31,.33,.35,.37,.39..........
2nd column=.32,.34,.36,.38,.41.............
3rd column=.41,.43,.45,.47,.49,.51...............
4th column=.42,.44,.46,.48,50,,,,,,,,,,,
5th column=0.51,0.53,0.55,.57,.59,.61...........
6th column =0.52,0.54,0.56,.85,.60
with 100 rows and 6 columns,please help

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 2월 13일
out = ...
bsxfun(@plus,reshape(bsxfun(@plus,.31:.1:.51,[0;.01]),1,[]),[0; .02*(1:99)']);
OR
out = reshape(permute(reshape(...
bsxfun(@plus,.31:.1:.51,[0;.01*(1:199)']).',3,2,[]),[3 2 1]),[],6);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by