HOW TO CREATE THİS MATRİX

100x100 matrix
0 1 2 ....... 99
1 2 3 ....... 100
2 3 4 ....... 101
. . . ........ .......
. . . ....... ........
. . . ....... .......
99 100 101 102 ..... 198

3 件のコメント

HilaN
HilaN 2019 年 3 月 5 日
編集済み: madhan ravi 2019 年 3 月 5 日
a=[];
N=100;
T=N;
for i=1:N
a(i,:) = [i-1:1:T-1];
T=T+1;
end
MERT METIN
MERT METIN 2019 年 3 月 5 日
no right run
HilaN
HilaN 2019 年 3 月 5 日
why not? this is the matrix you wanted, or I didn't got right what you are asking..

サインインしてコメントする。

回答 (3 件)

Stephan
Stephan 2019 年 3 月 5 日
編集済み: Stephan 2019 年 3 月 5 日

0 投票

Hi,
beginning from R2016b you can use:
A = [0:99] + [0:99]'
or - with respect to Madhans comment for prior releases:
B = bsxfun(@plus, [0:99], [0:99]')
Best regards
Stephan

8 件のコメント

MERT METIN
MERT METIN 2019 年 3 月 5 日
no :(
Stephan
Stephan 2019 年 3 月 5 日
Whats wrong with it? For me it gives exactly the result you wanted. So please clarify.
MERT METIN
MERT METIN 2019 年 3 月 5 日
ıt is my homework and this solution is not basic. I need basic solution. we dont learn bsxfun function :(
MERT METIN
MERT METIN 2019 年 3 月 5 日
my Matlab version is 2018b
Stephan
Stephan 2019 年 3 月 5 日
編集済み: Stephan 2019 年 3 月 5 日
A = [0:99] + [0:99]'
is basic - it could not be more basic... But i guess you have to write something like a loop.
madhan ravi
madhan ravi 2019 年 3 月 5 日
People here don’t do obvious homework problems, come up with the code that you have tried.
Stephan
Stephan 2019 年 3 月 5 日
Madhan is right. Show your attempts so far and tell us where your secific problems are.
MERT METIN
MERT METIN 2019 年 3 月 5 日
this question is not only one. ı have another questions from homework but ı did others. Just this question ı did not. Thank you for everything.

サインインしてコメントする。

madhan ravi
madhan ravi 2019 年 3 月 5 日

0 投票

Just add the column vector which goes from 0 to 99 (step size 1) with the row vector which also has the same starting point and ending point as same as the column vector (step size 1).
doc colon

1 件のコメント

madhan ravi
madhan ravi 2019 年 3 月 5 日
If your version is prior to 2016b use bsxfun() with plus.

サインインしてコメントする。

Andrei Bobrov
Andrei Bobrov 2019 年 3 月 5 日

0 投票

hankel(0:99,(0:99)+99);

1 件のコメント

MERT METIN
MERT METIN 2019 年 3 月 5 日
not completely true

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2018b

質問済み:

2019 年 3 月 5 日

編集済み:

2019 年 3 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by