I created two arrays (double) with shape (500001,1). I need to change the shape of the arrays to be (5,500001). One has negative values on it. Is this possible?

답변 (1개)

Walter Roberson
Walter Roberson 2023년 2월 26일
elements_in_first = 2 * 500001 * 1
elements_in_first = 1000002
elements_in_second = 5 * 500001
elements_in_second = 2500005
elements_in_second / elements_in_first
ans = 2.5000
Your second array has 2 1/2 times as many elements as the first two put together. reshaping() the arrays will not work.
You would need to copy data, or to interpolate data, or use random data.

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품

질문:

2023년 2월 26일

답변:

2023년 2월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by