石岩君: 簡潔高效!
【Python】如何在文件夾里批量分割圖片?ijiayan: 用上了 謝謝你的切割圖像代碼
Matlab循環讀取txt文件並對其中數據進行計算最後導出為excelKK2896: 弄出來了,用Python比較容易實現
【Matlab】如何對二維矩陣進行線性/非線性插值?@Sean_: 寫成了函數供大家參考[code=plain]src = magic(10);scale_factor_width = 8; scale_factor_height = 8; [dst_bilinear, dst_bicubic] = test_interp(src,scale_factor_width,scale_factor_height);function [dst_bilinear, dst_bicubic] = test_interp(src, factor_width, factor_height)if ~isa(src, 'double') src = double(src);endwidth = size(src,2);height = size(src,1);x = 1:factor_width:get_index(width,factor_width);y = 1:factor_height:get_index(height,factor_height);[X,Y] = meshgrid(x,y); x = 1:get_index(width,factor_width);y = 1:get_index(height,factor_height);[Xq,Yq] = meshgrid(x,y);dst_bilinear = interp2(X,Y,src,Xq,Yq); dst_bicubic = interp2(X,Y,src,Xq,Yq,'bicubic'); figure(1); title("result of bilinear interpolate");surf(dst_bilinear);colorbar;figure(2); title("result of bicubic interpolate");surf(dst_bicubic);colorbar;endfunction index = get_index(i, scale_factor)index = (i - 1) * scale_factor + 1;end[/code]
Matlab循環讀取txt文件並對其中數據進行計算最後導出為excelZezeGuowang: 我也想問,你知道了嗎?