Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Matrix-transposition/MATLAB/matrix-transposition-1.m
Normal file
13
Task/Matrix-transposition/MATLAB/matrix-transposition-1.m
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
>> transpose([1 2;3 4])
|
||||
|
||||
ans =
|
||||
|
||||
1 3
|
||||
2 4
|
||||
|
||||
>> [1 2;3 4].'
|
||||
|
||||
ans =
|
||||
|
||||
1 3
|
||||
2 4
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
B=size(A); %In this code, we assume that a previous matrix "A" has already been inputted.
|
||||
for j=1:B(1)
|
||||
for i=1:B(2)
|
||||
C(i,j)=A(j,i);
|
||||
end %The transposed A-matrix should be C
|
||||
end
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
xy = {{1,2,3,4},{1,2,3,4},{1,2,3,4}}
|
||||
yx = feval(@(x) cellfun(@(varargin)[varargin],x{:},'un',0), xy)
|
||||
Loading…
Add table
Add a link
Reference in a new issue