필터 지우기
필터 지우기

concatenating 4 columns of different dimensions

조회 수: 9 (최근 30일)
Chaitanya Bade
Chaitanya Bade 2017년 5월 19일
댓글: Chaitanya Bade 2017년 5월 20일
I have four column vectors out of which two are of one size while the other two are of another size. For example
TIMESTEPS = 0.02, 0.05, 0.10, 0.17, 0.19
XDATA = 0.1, 0.2, 0.3, 0.4, 0.5
PEAKTIME = 3, 7, 9
PEAKVALS = 4, 6, 8
I want to concatenate them horizontally and fill up the spaces with zero and write to a excel data file using csvwrite. How do I do it?
Any help would be highly appreciated.
Thanks!

채택된 답변

Walter Roberson
Walter Roberson 2017년 5월 19일
M = TIMESTEPS;
M(1:length(XDATA),2) = XDATA;
M(1:length(PEAKTIME),3) = PEAKTIME;
M(1:length(PEAKVALS),4) = PEAKVALS;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Embedded Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by