Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
shift.m
Package: 444.zip [view]
Upload User: gzcxg999
Upload Date: 2021-07-15
Package Size: 190k
Code Size: 1k
Category:
matlab
Development Platform:
CHM
- % Program 5-4
- % shift.m
- %
- % Shift the contents of the register.
- %
- % Programmed by M.Okita and H.Harada
- %
- function [outregi] = shift(inregi,shiftr,shiftu)
- % ****************************************************************
- % inrege : Vector or matrix
- % shiftr : The amount of shift to the right.
- % shiftu : The amount of shift to the top.
- % outregi : Register output
- % ****************************************************************
- [h, v] = size(inregi);
- outregi = inregi;
- shiftr = rem(shiftr,v);
- shiftu = rem(shiftu,h);
- if shiftr > 0
- outregi(:,1 :shiftr) = inregi(:,v-shiftr+1:v );
- outregi(:,1+shiftr:v ) = inregi(:,1 :v-shiftr);
- elseif shiftr < 0
- outregi(:,1 :v+shiftr) = inregi(:,1-shiftr:v );
- outregi(:,v+shiftr+1:v ) = inregi(:,1 :-shiftr);
- end
- inregi = outregi;
- if shiftu > 0
- outregi(1 :h-shiftu,:) = inregi(1+shiftu:h, :);
- outregi(h-shiftu+1:h, :) = inregi(1 :shiftu,:);
- elseif shiftu < 0
- outregi(1 :-shiftu,:) = inregi(h+shiftu+1:h, :);
- outregi(1-shiftu:h, :) = inregi(1 :h+shiftu,:);
- end
- %******************************** end of file ********************************