please help, how can i create the following matrix? ๐’‚ = ( ๐’† ๐Ÿ ๐’ ๐’ ๐’Ž ๐’† ๐Ÿ ๐’ ๐’Ž ๐’Ž ๐’† ๐Ÿ‘ โ‹ฏ ๐’ ๐’ ๐’ ๐’ ๐’ ๐’ โ‹ฎ โ‹ฑ โ‹ฎ ๐’Ž ๐’Ž ๐’Ž โ‹ฏ ๐’† ๐’ ๐’)

2 views (last 30 days)
Ahmad Walid
Ahmad Walid on 29 Apr 2022
Edited: Jan on 29 Apr 2022
  3 Comments
Jan
Jan on 29 Apr 2022
As usual for homework questions: Please post what you have tried so far and ask a specific question. The forum will not solve your homework.
By the way, this is not twitter: no # before the tags. There is no need for a "matlab" tag, because this is a Matlab forum. Thanks.

Sign in to comment.

Answers (1)

Jan
Jan on 29 Apr 2022
Use the functions triu, diag and tril .
Another option is to start with zeros(m, n) and running 2 for loops. Then compare the indices:
if i1 == i2
A(i1, i2) = exp(i1)
elseif i1 < i2
...
else
...
end

Community Treasure Hunt

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

Start Hunting!