91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

可對任意大小的矩陣進行zigzag排序 可用于JPEG壓縮等過程。 Matlab程序 非常好用,歡迎下載!

資源截圖

代碼片段和文件信息

function?output?=?zigzag(input)
%input?=?rand(54);
%?turn?an?inputting?matrix?into?a?sequence?by?the?zigzag?order?wiht?length?of?total?data?in?the?matrix

%?size?of?matrix
[widlong]?=?size(input);

%?initialization?for?beginning.
direct?=?1;??????????%??direction?of?address?increasing
?????????????????????%??direct?==?1?indicate?increasing?from?j
?????????????????????%??direct?==?-1?indicate?increasing?from?i?
point?=?input;?????%%?address?of?point
count?=?1;?????????????%?number?counter
N?=?2;???????????????%?instantaneous?constant?

i?=?1;???????????????%%?address?valuable
j?=?1;

%??initialization?for?scan?order
sequence(count)?=?point(ij);
count?=?count?+?1;
????
while?N?<=?wid+long????%??endding?condition
???????
????while?direct?==?1???????????%??increase?from?j
????????i?=?i-1;
????????j?=?j+1;
????????
????????if?i?>?0?&?j?<=?long??????????????%??whether?it?is?the?border
????????????sequence(count)?=?point(ij);
????????????count?=?count?+?1;????
????????????
????????elseif?i?<=?0?&?j?<=?long???????????????%?when?scanning?border?is?occuring
????????????i?=?1;
????????????j?=?j;
????????????direct?=?-1;
????????????N?=?N+1;
????????????sequence(count)?=?point(ij);
????????????count?=?count?+?1;
????????????
????????else???????????????????????????????%??when?another?scanning?border?is?occuring????????
????????????j?=?long;

評論

共有 條評論