フィルターのクリア

add rows to a 344x2 matrix

1 回表示 (過去 30 日間)
bbah
bbah 2019 年 11 月 19 日
コメント済み: bbah 2019 年 11 月 19 日
i have a zeros matrix 344x2 and i want to loop over it so i can put in every row a 1x2 row vector
for i = 1:length(a)
j = a(i)
b = gnbh(j,2)
c = [j,b]
end
a is a vector with my indices and i got b from another matrix. In the end i got a 1x2 vector for every loop which is right and i want this vector for every loop to add to my 344x2 matrix.
In the end i want to have a 344x2 matrix and each row is my c vector.
thank you

採用された回答

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019 年 11 月 19 日
Solution:
matriz=zeros(344,2)
for i = 1:length(a)
j = a(i)
b = gnbh(j,2)
c = [j,b]
matriz(i,:)=c;
end
  1 件のコメント
bbah
bbah 2019 年 11 月 19 日
thank you sir

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by