Re: [問題] 關於 matlab 的這個指令

看板MATLAB作者 (成大機械研究僧-拔辣松)時間16年前 (2008/04/11 20:37), 編輯推噓6(602)
留言8則, 6人參與, 最新討論串1/1
※ 引述《jackycc (機奇)》之銘言: : PQ=paddedsize(size(f)); : 關於這個指令 我在網頁上 和書上都有看到 : 可是打再 matlab上卻說沒這指令 : 請問這指令到底可不可以用呢? 這個要自己加上去... 把下面這串存成paddedsize.m 吧 變成副程式來用 %-----% function PQ = paddedsize(AB, CD, PARAM) %PADDEDSIZE Computes padded sizes useful for FFT-based filtering. % PQ = PADDEDSIZE(AB), where AB is a two-element size vector, % computes the two-element size vector PQ = 2*AB. % % PQ = PADDEDSIZE(AB, 'PWR2') computes the vector PQ such that % PQ(1) = PQ(2) = 2^nextpow2(2*m), where m is MAX(AB). % % PQ = PADDEDSIZE(AB, CD), where AB and CD are two-element size % vectors, computes the two-element size vector PQ. The elements % of PQ are the smallest even integers greater than or equal to % AB + CD -1. % % PQ = PADDEDSIZE(AB, CD, 'PWR2') computes the vector PQ such that % PQ(1) = PQ(2) = 2^nextpow2(2*m), where m is MAX([AB CD]). if nargin == 1 PQ = 2*AB; elseif nargin == 2 & ~ischar(CD) PQ = AB + CD - 1; PQ = 2 * ceil(PQ / 2); elseif nargin == 2 m = max(AB); % Maximum dimension. % Find power-of-2 at least twice m. P = 2^nextpow2(2*m); PQ = [P, P]; elseif nargin == 3 m = max([AB CD]); %Maximum dimension. P = 2^nextpow2(2*m); PQ = [P, P]; else error('Wrong number of inputs.') end %---% -- ︿●﹁, δ 拔辣一顆外送唷 /╯ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.127.32

04/11 21:34, , 1F
雖然不是我的問題不過你好熱心~給你推一下
04/11 21:34, 1F

04/11 21:48, , 2F
推 (也推一樓的ID)
04/11 21:48, 2F

04/11 22:10, , 3F
恩 推!!!
04/11 22:10, 3F

04/11 22:23, , 4F
不敢居功...這是網路上找來的^^"
04/11 22:23, 4F

04/11 23:12, , 5F
要方便使用的話可以登錄進toolbox裡喔
04/11 23:12, 5F

04/11 23:30, , 6F
嗯嗯 目前我得把全部貼到WORK 檔案裡 也可以使用了
04/11 23:30, 6F

04/11 23:30, , 7F
不過登陸是要怎麼登錄呢?
04/11 23:30, 7F

04/12 02:35, , 8F
這是影像處理的作業嗎= =....這個副程式課本應該有
04/12 02:35, 8F
文章代碼(AID): #17_rjjr_ (MATLAB)
文章代碼(AID): #17_rjjr_ (MATLAB)