Info

This question is locked. 編集または回答するには再度開いてください。

Help me to solve

51 ビュー (過去 30 日間)
N/A
N/A 2024 年 10 月 30 日 6:54
Locked: John D'Errico 2024 年 10 月 30 日 12:15
Create the following matrix A.
1 2 3 4 5 6
A= 7 8 9 10 11 12
13 14 15 16 17 18
Use the matrix A to:
(a) Create a six-element row vector named ha that contains the elements of the first row of A.
(b) Create a three-element row vector named hb that contains the elements of the sixth column of A.
(c) Create a six-element row vector named hc that contains the first three elements of the second row of A and the last three element of the third row of A.

回答 (1 件)

Shivam
Shivam 2024 年 10 月 30 日 6:57
Refer to the workaround to achieve the goal:
% Define the matrix A
A = [1 2 3 4 5 6;
7 8 9 10 11 12;
13 14 15 16 17 18];
% (a) First row of A
ha = A(1, :);
% (b) Sixth column of A, transposed to a row vector
hb = A(:, 6)';
% (c) Combination of elements from the second and third rows
hc = [A(2, 1:3), A(3, 4:6)];
% Display the results
disp('ha =');
disp(ha);
disp('hb =');
disp(hb);
disp('hc =');
disp(hc);
Hope it helps.
  1 件のコメント
John D'Errico
John D'Errico 2024 年 10 月 30 日 12:15
Please don't do student homeworks for them. When no effort has been made, then the student will learn nothing form your efforts, except that there is some sucker willing to do their homework.
You hurt the forum, since now @TERESA has seen that someone will step forwards wnd write their complete assignment for them. And that makes the student keep on doing the same.

This question is locked.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by