MATLAB: Loop through matlab vector

if for

Hey Guys. I am looking help with some code I wish to write. I have used code to write data from an Excel file manually by typing in each variable when prompted.

Best Answer

Attach a CSV file so we can get started helping you. In the meantime, you probably want to do something like
numRows = height(t); % or size(t, 1)
patient_outcome = false(numRows, 1);
for row = 1 : numRows
if (chest_pain_type(row)>3) &&&& (serum_cholestoral(row)>0) && (st_depression(row)>0.8) && (gender(row)>0)
patient_outcome(row) = true;
elseif (chest_pain_type(row)>3) && (serum_cholestoral(row)>0) && (st_depression(row)>0.8) && (gender(row)<=0) && (heart_condition(row)>3)
patient_outcome(row) = true;
elseif (chest_pain_type(row)>3) && (serum_cholestora(row)l>0) && (st_depression(row)>0.8) && (gender(row)<=0) && (heart_condition(row)<=3) && (exercise_induced_angina(row)>0)
patient_outcome(row) = false;
end
end