Please help me convert equation to matlab code

1 回表示 (過去 30 日間)
Mary Joyce Habana
Mary Joyce Habana 2021 年 10 月 24 日
コメント済み: John D'Errico 2021 年 10 月 26 日
Please help me convert equation to matlab code

回答 (3 件)

Sargondjani
Sargondjani 2021 年 10 月 24 日
[0 0 0;1 2 3] is an example of a matrix i Matlab. Please try the rest yourself. We are not here to do your homework. If you gave it a try, and fail, then come with specific questions what you dont understand.

Image Analyst
Image Analyst 2021 年 10 月 24 日
Use sqrt() for square root, pi for pi, commas between columns, and semicolons between rows. For example
m = [0, 1, pi;
sqrt(2), 2, 0]
m =
0 1 3.1416
1.4142 2 0
Adapt as needed to your homework.

yanqi liu
yanqi liu 2021 年 10 月 26 日
clc; clear all;
A = [ones(2, 3) zeros(2,2)
eye(3) ones(3,1) zeros(3,1)]
A = 5×5
1 1 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0
B = [pi*ones(1,5)
ones(1,5)
zeros(1,5)
ones(1,5)]
B = 4×5
3.1416 3.1416 3.1416 3.1416 3.1416 1.0000 1.0000 1.0000 1.0000 1.0000 0 0 0 0 0 1.0000 1.0000 1.0000 1.0000 1.0000
C = sqrt(2)*ones(3,3)
C = 3×3
1.4142 1.4142 1.4142 1.4142 1.4142 1.4142 1.4142 1.4142 1.4142
  2 件のコメント
Image Analyst
Image Analyst 2021 年 10 月 26 日
Unfortunately now she'll have to come up with a different way to do this
because you gave a complete solution, unlike the other answers that just gave hints. Some universities employ plagiarism detectors, which scan the web for similar code, meaning she can't submit your solution as her own or else she'll get caught cheating. However, she might be okay because there are a very limited number of ways to make this matrix so it's possible students could have thought of it on their own, even if you hadn't posted the answer.
John D'Errico
John D'Errico 2021 年 10 月 26 日
Please don't do homework assignments for people. That does not help them, except to learn there is sometimes someone out there who is foolish enough and willing to do their work for them.

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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by