MATLAB: Display diagonal values from vector answers

%EXAMPLE
clear all
clc
t=linspace(0,5,6);
x=linspace(10,15,6);
for i=1:length(t)
vec=x*t(i)
end
Is it possible to display/calculate only the diagonal of this, i.e. vec=0 11 24 39 56 75?
Thanks
ewan

Best Answer

Wouldn't that just be
vec=x.*t
Otherwise, clarify what "diagonal of this" means. As it stands, there are no matrices in your code to speak of and therefore no "diagonal".