matrix Combine difference size

4 ビュー (過去 30 日間)
Gülsah Çifçi
Gülsah Çifçi 2021 年 8 月 8 日
コメント済み: Gülsah Çifçi 2021 年 8 月 8 日
Datas=[3.9717, 10.9791, 14.4306, 16.6604,16.5421, 13.9692; 5.9904, 10.2624, 14.3976, 16.5259, 16.5860, 13.8606]
allDataX=zeros(7,45)
for i=1:44
allDataX(:,i)=[i;Rss']
end
But Datas change size ı cant do.How can ı do

採用された回答

Walter Roberson
Walter Roberson 2021 年 8 月 8 日
I am having to guess about what you are trying to do.
Datas=[3.9717, 10.9791, 14.4306, 16.6604,16.5421, 13.9692; 5.9904, 10.2624, 14.3976, 16.5259, 16.5860, 13.8606]
Datas = 2×6
3.9717 10.9791 14.4306 16.6604 16.5421 13.9692 5.9904 10.2624 14.3976 16.5259 16.5860 13.8606
allDataX = zeros(size(Datas,2)+1,size(Datas,1));
for i=1:size(Datas,1)
allDataX(:,i)=[i;Datas(i,:).'];
end
allDataX
allDataX = 7×2
1.0000 2.0000 3.9717 5.9904 10.9791 10.2624 14.4306 14.3976 16.6604 16.5259 16.5421 16.5860 13.9692 13.8606
Or...
allDataX = [1:size(Datas,1); Datas.'];
allDataX
allDataX = 7×2
1.0000 2.0000 3.9717 5.9904 10.9791 10.2624 14.4306 14.3976 16.6604 16.5259 16.5421 16.5860 13.9692 13.8606
  3 件のコメント
Gülsah Çifçi
Gülsah Çifçi 2021 年 8 月 8 日
I want to this matrix
1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000....44
3.9717 3.9717 3.9717 3.9717 3.9717 3.9717 3.9717 3.9717 3.9717 3.9717.....
10.9791 10.9791 10.9791 10.9791 10.9791 10.9791 10.9791 10.9791 10.9791 10.9791
14.4306 14.4306 14.4306 14.4306 14.4306 14.4306 14.4306 14.4306 14.4306 14.4306
16.6604 16.6604 16.6604 16.6604 16.6604 16.6604 16.6604 16.6604 16.6604 16.6604
16.5421 16.5421 16.5421 16.5421 16.5421 16.5421 16.5421 16.5421 16.5421 16.5421
13.9692 13.9692 13.9692 13.9692 13.9692 13.9692 13.9692 13.9692 13.9692 13.9692
5.9904 5.9904 5.9904 5.9904 5.9904 5.9904 5.9904 5.9904 5.9904 5.9904......
10.2624 10.2624 10.2624 10.2624 10.2624 10.2624 10.2624 10.2624 10.2624 10.2624
14.3976 14.3976 14.3976 14.3976 14.3976 14.3976 14.3976 14.3976 14.3976 14.3976
16.5259 16.5259 16.5259 16.5259 16.5259 16.5259 16.5259 16.5259 16.5259 16.5259
16.5860 16.5860 16.5860 16.5860 16.5860 16.5860 16.5860 16.5860 16.5860 16.5860
13.8606 13.8606 13.8606 13.8606 13.8606 13.8606 13.8606 13.8606 13.8606 13.8606
Gülsah Çifçi
Gülsah Çifçi 2021 年 8 月 8 日
How can ı write this code get this matrix

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by