resize a matrix (1x30) to (1x25)

2 ビュー (過去 30 日間)
Naema
Naema 2014 年 11 月 25 日
編集済み: Orion 2014 年 11 月 25 日
Hi: I have (g) a matrix with size (1x30) and wanted to resize it to (1x25), how can I do this? I think I should keep the min and max numbers in order not to destroy the data and somehow average the numbers in middle to get red of 5 numbers. Can someone here assist me with this? thanks

採用された回答

Orion
Orion 2014 年 11 月 25 日
編集済み: Orion 2014 年 11 月 25 日
Hi,
you could use interp1
g = rand(1,30);
newx = linspace(1,30,25);
newg = interp1(g,newx);
plot(g,'b-+');
hold on;
plot(newx,newg,'ro');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by