matlab里x=x([],[],:ed:x=x([end-hs1+1:end,1:end-hs1],[end-hs2+
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/14 21:33:04
matlab里x=x([],[],:ed:x=x([end-hs1+1:end,1:end-hs1],[end-hs2+1:end,1:end-hs2],:)
x=x([],[],:)这个说明矩阵x为m*n*k维的矩阵,即x由k个m*n维的矩阵组成,式中的hs1,hs2应该是变量或常量,end表示矩阵的最后一列或最后一行的序号.
x=x([end-hs1+1:end,1:end-hs1],[end-hs2+1:end,1:end-hs2],:) %将x中所有k个矩阵,将end-hs1+1到end行,end-hs2+1到end列的元素放在矩阵的左上角;end-hs1+1到end行,1到end-hs2列的元素放在右上角;1到end-hs1行,end-hs2+1到end列的元素放在左下角;1到end-hs1行,1到end-hs2列的元素放在右下角;
其实就是,以 后hs1行 和 后hs2列 为分界线,把x分成四个小矩阵,
例如:x=[A B
C D];
然后将A,D位置互换,B,C位置互换,即得到
x=x[D C
B A];
>>hs1=2;hs2=3;x=rand(6) %以后2行和后3列为分界线把矩阵分成4部分
x =
0.3046 0.1509 0.4966 0.3420 0.8385 0.6946
0.1897 0.6979 0.8998 0.2897 0.5681 0.6213
0.1934 0.3784 0.8216 0.3412 0.3704 0.7948
0.6822 0.8600 0.6449 0.5341 0.7027 0.9568
0.3028 0.8537 0.8180 0.7271 0.5466 0.5226
0.5417 0.5936 0.6602 0.3093 0.4449 0.8801
>> c=x([end-hs1+1:end,1:end-hs1],[end-hs2+1:end,1:end-hs2])
c =
0.7271 0.5466 0.5226 0.3028 0.8537 0.8180
0.3093 0.4449 0.8801 0.5417 0.5936 0.6602
0.3420 0.8385 0.6946 0.3046 0.1509 0.4966
0.2897 0.5681 0.6213 0.1897 0.6979 0.8998
0.3412 0.3704 0.7948 0.1934 0.3784 0.8216
0.5341 0.7027 0.9568 0.6822 0.8600 0.6449
x=x([end-hs1+1:end,1:end-hs1],[end-hs2+1:end,1:end-hs2],:) %将x中所有k个矩阵,将end-hs1+1到end行,end-hs2+1到end列的元素放在矩阵的左上角;end-hs1+1到end行,1到end-hs2列的元素放在右上角;1到end-hs1行,end-hs2+1到end列的元素放在左下角;1到end-hs1行,1到end-hs2列的元素放在右下角;
其实就是,以 后hs1行 和 后hs2列 为分界线,把x分成四个小矩阵,
例如:x=[A B
C D];
然后将A,D位置互换,B,C位置互换,即得到
x=x[D C
B A];
>>hs1=2;hs2=3;x=rand(6) %以后2行和后3列为分界线把矩阵分成4部分
x =
0.3046 0.1509 0.4966 0.3420 0.8385 0.6946
0.1897 0.6979 0.8998 0.2897 0.5681 0.6213
0.1934 0.3784 0.8216 0.3412 0.3704 0.7948
0.6822 0.8600 0.6449 0.5341 0.7027 0.9568
0.3028 0.8537 0.8180 0.7271 0.5466 0.5226
0.5417 0.5936 0.6602 0.3093 0.4449 0.8801
>> c=x([end-hs1+1:end,1:end-hs1],[end-hs2+1:end,1:end-hs2])
c =
0.7271 0.5466 0.5226 0.3028 0.8537 0.8180
0.3093 0.4449 0.8801 0.5417 0.5936 0.6602
0.3420 0.8385 0.6946 0.3046 0.1509 0.4966
0.2897 0.5681 0.6213 0.1897 0.6979 0.8998
0.3412 0.3704 0.7948 0.1934 0.3784 0.8216
0.5341 0.7027 0.9568 0.6822 0.8600 0.6449
matlab里x=x([],[],:ed:x=x([end-hs1+1:end,1:end-hs1],[end-hs2+
matlab 中plot(x(L-500:end,1),x(L-500:end,
matlab x(:,:,end) = x是一个三维矩阵
end
matlab画图 我定义的函数 function y = F( x) y=exp(-x)-x; end
matlab 中B=A(end:-1:1,:C=A(:,end:-1:
matlab中的这个a=[a(end) a(1:end-1)
matlab中,形如A=A(end-6:end-1,
请问下面Matlab定义函数中if nargin==0,x=0:.05:1;end有什么用?后面2个if作用是什么
下面程序表示的函数解析式是,if x>0,then y=2^x+1,else y=x*x+2*x,end if,prin
Dim x&,r&,k&,i& r = Range("G65536").End(xlUp).Row For x = 2
matlab程序:data2=[0,data1(1:end-1)]; (1: