Data is all spaced out, I want it to fill from first row in matrix

조회 수: 1 (최근 30일)
Franchesca
Franchesca 2014년 5월 14일
I have this code:
%% Combine the data %combined = [6050,54]% define size of combined
SWOA = zeros(100,5); CWOA = zeros(100,5); SWA = zeros(100,5); CWA = zeros(100,5);
for i = 8:length(mydata)%loop to group data together into jump types
if grouped(i,4) == 1
SWOA(i,1) = grouped(i,1);
else if grouped(i,4) == 2
CWOA(i,1) = grouped(i,1);
else if grouped(i,4) == 3
SWA(i,1) = grouped(i,1);
else if grouped(i,4) == 4
CWA(i,1) = grouped(i,1);
else if grouped(i,4)== 0
continue
end
end
end
end
end
end
I have wrote the code so that if fills the row with the corresponding trial number however this is the result:
Instead of writing them to the corresponding row number I want it to fill the variable from row 1 cell 1 but in the loop I know I have writen for example SWOA(i,1) which I don't know how to change as it is in a loop and I need all the values, I don't want it to overwrite everytime.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by