필터 지우기
필터 지우기

I have a cell array 1x7 and every matrix contains 5844x4double and they're all same size. Now i need to extract data from each cell array and each matrixe(5844x4double ) and t

조회 수: 2 (최근 30일)
I have a cell array 1x7 and every matrix contains 5844x4double and they're all same size. Now i need to extract data from each cell array and each matrixe(5844x4double ) and the create other matrix containing the data from each cell array and each matrixe(5844x4double ). how can i do that ?
for i=1:length(cellarrray)
for j = 1:5844
dy_strfr1= rfdata_tsstrfr1{1,i}(1:j,4)
elv_strfr1= ellnlt_stallrfr1{1,i}(1:j,1)
lon_strfr1= ellnlt_stallrfr1{1,i}(1:j,2)
lat_strfr1= ellnlt_stallrfr1{1,i}(1:j,3)
end
end
  댓글 수: 4
Habtamu Tsegaye
Habtamu Tsegaye 2022년 4월 7일
@Arif Hoq how can I attached the mat data?
@David Hill ya, I want to extract the data from each matrix within my cell array and store the extracted data in the matrix. forexample I do have {5844x4double, 5844x4double, 5844x4double, 5844x4double, 5844x4double, 5844x4double, 5844x4double} now i want to extract one data from each cell arra and stor it as [i1; i2; i3; i4; i5; i6; i7].
Stephen23
Stephen23 2022년 4월 7일
"how can I attached the mat data?"
Save all relevant variables in one mat file. Then click the paperclip button in your answer/comment to upload it.

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

채택된 답변

Arif Hoq
Arif Hoq 2022년 4월 7일
how can I attached the mat data?
just right click on the mat file > save as > put any name.
here I have tried to make a cell array with random data.
a=randi(100,5844,4);
b=randi(200,5844,4);
c=randi(300,5844,4);
d=randi(400,5844,4);
e=randi(500,5844,4);
f=randi(600,5844,4);
g=randi(700,5844,4);
A={a;b;c;d;e;f;g}; % A is your cell array
B=[A{:}];
% expected variable
i1=B(:,1:4);
i2=B(:,5:8);
i3=B(:,9:12);
i4=B(:,13:16);
i5=B(:,17:20);
i6=B(:,21:24);
i7=B(:,25:28);
  댓글 수: 3
Habtamu Tsegaye
Habtamu Tsegaye 2022년 4월 7일
@Arif Hoq now i would like to take data for each day and each station(cell) and then store
Arif Hoq
Arif Hoq 2022년 4월 7일
try this:
A=load('rfdata.mat');
AA=A.rfdata_tsstrfr1 ;
rfdata=[AA{:}];
i1=rfdata(:,1:4);
i2=rfdata(:,5:8);
i3=rfdata(:,9:12);
i4=rfdata(:,13:16);
i5=rfdata(:,17:20);
i6=rfdata(:,21:24);
i7=rfdata(:,25:28);
B=load('elv_lon_lat.mat');
BB=B.ellnlt_stallrfr1;
stallrfr=[BB{:}];
x1=stallrfr(:,1:3);
x2=stallrfr(:,4:6);
x3=stallrfr(:,7:9);
x4=stallrfr(:,10:12);
x5=stallrfr(:,13:15);
x6=stallrfr(:,16:18);
x7=stallrfr(:,19:21);

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by