how to ➢get zeros beneath the pivot in each column.

1 visualización (últimos 30 días)
Ahmed
Ahmed el 17 de Nov. de 2020
Respondida: Monisha Nalluru el 20 de Nov. de 2020
function [x] = g_elimination( A,b )
[M,N] = size(A);
if M ~= N
error('Matrix A is not a square') ;
end

Respuestas (1)

Monisha Nalluru
Monisha Nalluru el 20 de Nov. de 2020
Hi Ahmed,
From my understanding, you want to add a row of zeros to matrix. This can be done in many ways,
First create a zeros matrix of required 1 by N where N is number of columns. After use direct assignment or cat function
As an example
A=[1 2 3; 3 4 5; 6 7 8];
Z=zeros(1,3);
newarray=[A;Z]
or
newarray= cat(1,A,Z)

Categorías

Más información sobre NaNs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by