create matrix from other two matrices

조회 수: 1 (최근 30일)
rana mamdouh
rana mamdouh 2019년 7월 28일
편집: dpb 2019년 7월 29일
Hello
i have matrix
tem_n1 = (1224,1) and
tem_n2= (459 ,1),
i need to do matrix temperature (1683,1) by taking the first 7 rows in matrix tem_n1, 4 rows in matrix tem_n2..
i already created temp is (11,1) i do not know how to proced and get temperature (1683,1)
[n5,m5]=size(tem_n1);
a5=1:n5;
ind5=find(and(mod(a5,1224)<8,mod(a5,1224)>0));
tem_m1 =tem_n1(ind5,1);
[n6,m6]=size(tem_n2);
a6=1:n6;
ind6=find(and(mod(a6,459)<5,mod(a6,459)>0));
tem_m2 =tem_n2(ind6,1);
tem_m = [tem_m1; tem_m2] ;
  댓글 수: 4
dpb
dpb 2019년 7월 29일
편집: dpb 2019년 7월 29일
But neither of the two arrays is divisible by 7 or 4...and as above, there's a large discrepancy between the number of sets of 7 vis a vis 4 you can do with the two arrays...
Can't do what you say you want...
>> n5/153
ans =
8
>> n6/153
ans =
3
>>
aren't 7 and 4 but 8 and 3.
rana mamdouh
rana mamdouh 2019년 7월 29일
okay, you are right. now how to do it with 8 form temp_n1 and 3 form temp_n2 ???

댓글을 달려면 로그인하십시오.

채택된 답변

dpb
dpb 2019년 7월 29일
편집: dpb 2019년 7월 29일
t=reshape([reshape(temp_n1,8,[]);reshape(temp_n2,3,[])],[],1);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by