필터 지우기
필터 지우기

replicating a cell vector of dates

조회 수: 2 (최근 30일)
antonet
antonet 2012년 6월 21일
Dear all,
I have the cell vector
jji=
'JAN 2009'
'FEB 2009'
'MAR 2009'
'APR 2009'
'MAY 2009'
'JUN 2009'
'JUL 2009'
'AUG 2009'
'SEP 2009'
'OCT 2009'
'NOV 2009'
'DEC 2009'
'JAN 2010'
'FEB 2010'
'MAR 2010'
'APR 2010'
'MAY 2010'
'JUN 2010'
'JUL 2010'
'AUG 2010'
'SEP 2010'
'OCT 2010'
'NOV 2010'
'DEC 2010'
and I want to replicate this vector 10 times.
So I do the following
B = jji(:,ones(10,1)); B1= B(:);
which works but in the excel file the output for the dates is expressed in numbers (number dates)
Is it possible to fix that so that in the data output file to see 'SEP 2010', 'OCT 2010', 'NOV 2010' instead of their corresponding numbers?
thanks
  댓글 수: 2
Ryan
Ryan 2012년 6월 21일
Are you sure that this is Matlab doing it and not Excel?
antonet
antonet 2012년 6월 21일
that 's a good question. I have to wait till tomorrow when i try this to my pc's office.
thanks anyway

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

채택된 답변

Jan
Jan 2012년 6월 22일
This problem does not concern Matlab, but the display in Excel. You can select the column and set the display format to "date".
Another method for replication:
B1 = repmat(B, 10, 1);
  댓글 수: 1
antonet
antonet 2012년 6월 22일
You are right. I checked this in my pc's office. thanks

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by