problem with matrix dimension
1 回表示 (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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 件のコメント
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 Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!