Matlab Matrix Help Needed on Annotation

10 ビュー (過去 30 日間)
Stanley
Stanley 2013 年 3 月 3 日
Hi guys, i need help on the annotation of the 4 annotate required field, my lecturer just threw these to us when we are not taught how to program in matlab =(( .
.
Appendix A: Code for Assignment Question 3
.
function x = Gauss(A, b)
% Solve linear system Ax = b
% using Gaussian elimination without pivoting
% A is an n by n matrix
% b is an n by k matrix (k copies of n-vectors)
% x is an n by k matrix (k copies of solution vectors)
[n, k] = size(b); % Annotate this
x = b; % Annotate this
for i = 1:n-1
m = -A(i+1:n,i)/A(i,i); % Annotate this
A(i+1:n,:) = A(i+1:n,:) + m*A(i,:); %Annotate this
b(i+1:n,:) = b(i+1:n,:) + m*b(i,:);
end;
% Use back substitution to find unknowns
x(n,:) = b(n,:)/A(n,n);
for i = n-1:-1:1
x(i,:) = (b(i,:) - A(i,i+1:n)*x(i+1:n,:))/A(i,i);
end

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 3 月 3 日
I think "annotate" here means "explain this in a comment".
  2 件のコメント
Stanley
Stanley 2013 年 3 月 3 日
yeah, but i dont understand the codes
Walter Roberson
Walter Roberson 2013 年 3 月 3 日

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

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by