Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a write a general Matlab code about; function [U,c]=GE_m[A,b] n=length (b) for k=1:n-1 use while ( %locate row that contains 1st nonzero %

I need a write a general Matlab code about;

function [U,c]=GE_m[A,b]

n=length (b)

for k=1:n-1

use "while" ( %locate row that contains 1st nonzero

% among n^n possible entries)

If r=k, no need to swap ( % If r not= k, swap rth and kth row,

% then go them GE

If r>n disp ( If all possible pivot entries have zero, print out

" A is not invertible and the U and c returned are meaningless." Then quit out)

Command window:

1) >> A= [ 1 -1 2 -1

2 -2 3 -3

1 1 1 0

1 -1 4 3]

>> b= [ -8 -20 2 4]' transpose

>> [U,c]=GE_m(A,b)

>>x=ut_sys(U,c) check both funtion match

2) >> A=[1 1 1

2 2 1

1 1 2]

>> b= [4 6 6]' transpose

>> [U,c]=GE_m(A,b)

should get U= [ 1 1 1

0 0 -1

0 0 1] and c=[ 4, -2, 2]' transpose.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Creating A Database In Filemaker Pro Visual QuickProject Guide

Authors: Steven A. Schwartz

1st Edition

0321321219, 978-0321321213

More Books

Students also viewed these Databases questions