How would I create a function using a positive integer 'q' in a 5 by q matrix, where row 'i' consists of i, 2i, 3i...qi.

1 Ansicht (letzte 30 Tage)
This is a homework question I have been stuck on.

Akzeptierte Antwort

Jan
Jan am 14 Feb. 2016
Bearbeitet: Jan am 14 Feb. 2016
You do not need bsxfun, because Matlab uses the dyadic product for [N x 1] * [1 x M] arrays:
q = 7;
(1:5).' * (1:q)
Sorry for solving your homework. You could try to solve this with two nested loops instead. Simply try it and post the code in case of problems.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by