Purchase Solution

Matlab : Lutx Function

Not what you're looking for?

Ask Custom Question

I was trying to modify the matlab built-in lutx function, by using for loops, but when I tested the results with my new function it didn't give the same results.

Please see the attached file for the fully formatted problems.

Attachments
Purchase this Solution

Solution Summary

This solution provides a detailed step by step explanation of the given discrete math problem.

Solution Preview

** Please see the attached file for the complete solution **
Thanks for using BrainMass.

function [L,U,p] = lutx(A)
%LU Triangular factorization
% [L,U,p] = lutx(A) produces a unit lower triangular
% matrix L, an upper triangular matrix U, and a
% permutation vector p, so that L*U = A(p,:).
[n,n] = size(A);
p = (1:n)'
for k = 1:n-1
% Find largest element below diagonal in k-th column
[r,m] = max(abs(A(k:n,k)));
m = m+k-1;
% Skip elimination if column is zero
if (A(m,k) ~= 0)
% Swap pivot row
if (m ~= k)
A([k m],:) = A([m k],:);
p([k m]) = p([m k]);
end
% Compute multipliers
i = k+1:n;
A(i,k) = A(i,k)/A(k,k);
% ...

Purchase this Solution


Free BrainMass Quizzes
Probability Quiz

Some questions on probability

Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.

Geometry - Real Life Application Problems

Understanding of how geometry applies to in real-world contexts

Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.