Re: [討論] 請教MATLAB題目

看板MATLAB作者 (SupP)時間9年前 (2016/03/27 21:13), 9年前編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
※ 引述《sads333 (阿鼎)》之銘言: : 請問這題程式怎麼寫?翻遍課本還是想不出來該怎麼寫 : 1.Shift a.bmp to the right by twenty pixels, and call the : resulting image a_r20.bmp 向右移動20個像素並輸出影像 題意沒理解錯誤的話如下: % 載入影像 a = imread('a.bmp'); % 影像向右移動20像素, 大小不變 a_r20 = [zeros(size(a,1), 20) a(:, 1:end-20)]; % 輸出影像 imwrite(a_r20, ['a_r20.bmp']); : 2.Shift a_r20.bmp downwards by fifty pixels, and call the resulting image : a_r20_d50.bmp 向下移動50個像素並輸出影像 題意沒理解錯誤的話如下 % 載入影像 a_r20 = imread('a_r20.bmp'); % 影像向下移動50像素, 大小不變 a_r20_d50 = [zeros(50, size(a_r20,2)) ; a_r20(1:end-50, :)]; % 輸出影像 imwrite(a_r20_d50, ['a_r20_d50.bmp']); -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.123.111.220 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1459084416.A.E39.html ※ 編輯: Portentera (140.123.111.220), 03/28/2016 11:17:53 ※ 編輯: Portentera (140.123.111.220), 04/07/2016 01:17:07
文章代碼(AID): #1Mzzo0uv (MATLAB)
文章代碼(AID): #1Mzzo0uv (MATLAB)