필터 지우기
필터 지우기

problem with matrix dimension

조회 수: 2 (최근 30일)
RADWAN A F ZEYADI
RADWAN A F ZEYADI 2022년 2월 8일
댓글: Jan 2022년 2월 8일
Hi
i have matrix (51*500) contain values for som properties but i want to put thi atrix along horiziontal axis for 80 position wich the final dimension becoms 51*80?

답변 (1개)

Jan
Jan 2022년 2월 8일
편집: Jan 2022년 2월 8일
How are input and output related? Maybe one of this methods do, what you need:
x = rand(51, 500);
y1 = x(:, 1:80); % First 80 columns
y2 = x(:, end - 79:end); % Last 80 columns
y3 = interp1(1:500, x.', linspace(1, 500, 80)).'; % Linear interpolation
  댓글 수: 3
RADWAN A F ZEYADI
RADWAN A F ZEYADI 2022년 2월 8일
doesnt work can i upload the code
Jan
Jan 2022년 2월 8일
Remember, that I still do not know, what you want to do. "Doesn't work" does not explain in any way, what is not working. So without knowing, what you want to achieve and what is failing, there is no chance to help you.

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

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by