필터 지우기
필터 지우기

I have 4 arrays of 335 elements each, i want one array(resultant) whcih consists of first array element in first element and first array element of second array into second element of resultant array and first array element of third array into third

조회 수: 2 (최근 30일)
eg: a=[1;2;3] b=[4;5;6] c=[7;8;9]
and i want d=[1;4;7;2;5;8;3;6;9]
please help me out,

답변 (2개)

bio lim
bio lim 2016년 12월 2일
편집: bio lim 2016년 12월 2일
Like this?
a=[1;2;3];
b=[4;5;6];
c=[7;8;9];
d = [a';b';c'];
d = reshape(d, [9 1]);
Output:
d =
1
4
7
2
5
8
3
6
9
  댓글 수: 6
bio lim
bio lim 2016년 12월 2일
It's still the same approach.
a=rand(335,1);
b=rand(335,1);
c=rand(335,1);
d=rand(335,1);
e=[a';b';c';d'];
e = reshape(e, [1340 1]);

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


KSSV
KSSV 2016년 12월 2일
clc; clear all ;
a=[1;2;3] ;
b=[4;5;6] ;
c=[7;8;9] ;
abc = [a b c]' ;
iwant = abc(:)

카테고리

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