필터 지우기
필터 지우기

creating matrices from taking specific entries of multiple matrices

조회 수: 3 (최근 30일)
fadzhi
fadzhi 2021년 2월 5일
댓글: fadzhi 2021년 2월 5일
Dear all,
I have a set of 4 matrices and i want to create multiple matrices by taking respetive column entries from these 4 matrices. For example,
matrix 1 = [first column A first colum B first column C First column D]
.............
.........
matrix n 0 [nth column A nth column B nth column C nth column D]
Many thanks for your suggestions
  댓글 수: 1
fadzhi
fadzhi 2021년 2월 5일
편집: fadzhi 2021년 2월 5일
i am now using following code but i am only getting the last combination repeated in all cells. Perhaps osmebody can point out the error?
[x y] = size(Temp); %where Temp is one of the four matrices
t = cell(y,1)
for k = 1:y
t{k}= [Temp(:,[k]) strain_rate(:,[k]) strain_y(:,[k]) stress(:,[k])];
end;

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 2월 5일
Once I tried to repoduce simmilar case, I did not find any issue
A=randi(10,[5,4]);
B=randi(10,[5,4]);
C=randi(10,[5,4]);
D=randi(10,[5,4]);
Mat=cell(1,size(A,2));
for i=1:size(A,2)
Mat{i}=[A(:,i),B(:,i),C(:,1),D(:,i)];
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by