How can I create a table or matrix of 193 rows and 117 columns?
1 回表示 (過去 30 日間)
古いコメントを表示
for i=0:115;x(1,i+1)=5+i;end
j = 1;
for i=10:200;v(j+1,1)= i; j =j+1;end
I want all the x values in columns -->116 values and v = 192 rows
The matrix has to be of 193 rows x 117 columns to have in the 1 column all the v values and start from the second column all the x values.
Like this:
0 5 6 7 9 8 10 11 . . . . . . . . 120
10
11
12
13
14
.
.
.
200
0 件のコメント
採用された回答
Guillaume
2020 年 1 月 24 日
Your description is really not clear and more importantly, it's very unlikely that what you're trying to do is the correct approach. It would be a good idea for you to explain what the ultimate goal is instead of the 1st step.
Also, you haven't said what should go in the rest of the matrix. I'm assuming 0s here:
desiredmatrix = [0, 5:120; [(10:200)', zeros(191, 116)]]
Another way:
desiredmatrix = zeros(192, 117);
desiredmatrix(1, 2:end) = 5:120;
desiredmatrix(2:end, 1) = 10:200;
You certainly don't need loops.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!