MATLAB: How to get all values S and t in same matrix m

how to get all values s and t in same matrix m?

clc
clear
for S=1:0.1:10;
t=1.1346*log((-0.6*S)+7)-(0.0651*log(S));
if t>=0
S;
t;
m=[t S]
else
end
end

Best Answer

m=[]
for S=1:0.1:10;
t=1.1346*log((-0.6*S)+7)-(0.0651*log(S));
if t>=0
S;
t;
m=[m; t S]
else
end
end
You can avoid for loop
S=1:0.1:10;
t=1.1346*log((-0.6*S)+7)-(0.0651*log(S));
idx=t>0
m=[t(idx)' S(idx)']