How can I define a matrix M
according to M=[a:(b-a)/5:b]
(from a
to b
in 5 steps), when a
and b
are vectors or sets; more specifically, each row i
in M
should have a first value equal to a(i)
and last value b(i)
and, in between, 5 equal steps.
For example, if I have
a = [0; b = [10;
0]; 20];
I'd like to produce a matrix M
of the form
[0 2 4 6 8 10;...
0 4 8 12 16 20]
I know how to do this using loops, but I'm looking for a solution without. How can I do that?