资源简介
可对任意大小的矩阵进行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;
- 上一篇:matlab图像拼接算法
- 下一篇:Matlab 图像链码获取
相关资源
- Matlab 图像链码获取
- matlab图像拼接算法
- matlab求解共线方程公式以及生成等高
- 有关emd分解的matlab源程序
- 离散粒子群算法DPSOMatlab代码
- Hata传播模型Matlab代码
- 基于matlab的汉字识别系统和
- matlab批量读入excel表格,可以读文件和
- matlab画ROC曲线
- matlab计算表面曲率
- 禁忌搜索解决背包问题matlab
- 蚁群算法解决背包问题matlab
- matlab遗传算法解决背包问题
- matlab实现meanshift图像分割
- MATLAB常规均匀圆阵波束形成
- 小波基构造函数 Matlab函数
- 多种插值算法Matlab实现--数学建模
- 智能优化算法及其MATLAB源程序
- qpsk调制stbc仿真
- matlab递归生成树
- 寻找割集的matlab算例程序
- 计算短时过零率MATLAB
- 用matlab实现模拟退火kmeans聚类
- 逐步回归MATLAB程序(新)
- [MATLAB+R2017a人工智能算法][张德丰][程
- sgy地震波数据文件及MATLAB处理sgy文件
- 信道编码程序matlab
- 二维粒子群算法的matlab源程序.docx.z
- QPSKMATLAB仿真程序
- Matlab 下限制边界泰森多边形voronoi计算
评论
共有 条评论