How to Concatenate the result in for loop?

조회 수: 1 (최근 30일)
Kris Sarikanoppakhun
Kris Sarikanoppakhun 2021년 4월 3일
Hello every one
I'm very new in matlab
I have some problem how do i concatenate the result from for loop?
for i=0:bond(860) %bond is the data table include 861*36 table of number
a=[bond(i+1,:)];
B=[repmat(a(1),[length(nonzeros(a))-1 1]) nonzeros(a(2:end)')];
end
the result is
B =
16×2 uint32 matrix
860 796
860 797
860 798
860 816
860 817
860 818
860 819
860 836
860 837
860 838
860 839
860 840
860 857
860 858
860 859
860 861
B =
12×2 uint32 matrix
861 797
861 798
861 817
861 818
861 819
861 837
861 838
861 839
861 840
861 858
861 859
861 860
This is a few result it have number 1 - 861
it show just the lastest result in B table
I want to get all result since 1 to 861 in the same arrey (concatenate all result in one table), want all result in B table not only the lastest calculation

답변 (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