1) Write a function reverse(A) which takes a matrix A of arbitrary dimensions as input and returns a

源代码在线查看: reverse.m

软件大小: 2 K
上传用户: yeling023
关键词: dimensions arbitrary function reverse
下载地址: 免注册下载 普通下载 VIP

相关代码

				% name 曾莉莉
				% id   07120482
				% email  07120482@bjtu.edu.cn
				% supervisor 丁晓明
				
				% reverse.m
				function [B]=reverse(A)
				% returns a matrix B consisting of the columns of A in reverse order.
				t=0;d1=0;d2=0;
				[d1,d2]=size(A);  %get the dimsize of matrix A
				for n=1:d1
				    for m=1:d2
				       B(n,m)=A(n,d2+1-m);
				    end
				end			

相关资源