채택된 답변

Stephen23
Stephen23 2017년 6월 2일
편집: Stephen23 2017년 6월 2일

1 개 추천

You should be able to figure it out from the example in the hankel documentation:
c = 1:3;
r = 3:6;
h = hankel(c,r)
h =
1 2 3 4
2 3 4 5
3 4 5 6
How to write functions, etc, is covered very clearly in the Introductory Tutorials, which are highly recommended for all beginners:

추가 답변 (1개)

Jan
Jan 2017년 6월 2일

0 개 추천

The question sound like a homework. Beside the suggested hankel function, there is a simple solution using elementary arithmetics only. It is such basic, that any hint is a solution already and it might look like cheating, if you submit it - assumed that it is really a homework. So think twice: Is asking without showing any own effort a good idea?
See:
(1:3) + (1:3).' % Requires Matlab >= 2016b
% Older versions:
% bsxfun(@plus, 1:3, (1:3).')
Now draw some conclusions.

카테고리

도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2017년 6월 2일

답변:

Jan
2017년 6월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by