How can I ensure that the output of X2MDATE is the same dimension as the input in the Financial Toolbox R2011a (4.0)?

조회 수: 1 (최근 30일)
The function X2MDATE alters the dimensions of n-dimensional arrays. For example if I set:
dates = cat(3, 40735, 40736, 40737)
and then call:
x2mdate(dates)
I get a 1×3 matrix returned. How can I get the 1×1×3 n-dimensional array that I expected?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2011년 7월 15일
The ability to obain an n-dimensional array output from X2MDATE that is the same size as the input is not available in the Financial Toolbox R2011a (4.0).
As a workaround, obtain an n-dimensional array that is the same dimensions as the input by using the RESHAPE function, as follows:
reshape(x2mdate(dates), size(dates))
Alternatively, use ARRAYFUN, as follows:
arrayfun(@x2mdate, dates)

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2011a

Community Treasure Hunt

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

Start Hunting!

Translated by