Borrar filtros
Borrar filtros

how to call two non-empty square matrixes?

1 visualización (últimos 30 días)
shoaib Ch
shoaib Ch el 3 de Mzo. de 2019
Editada: shoaib Ch el 2 de Abr. de 2019
his file to get the size of both input variables A and B and add further
statements to check that
A is a non-empty square matrix and B has the same number of rows
as A
% The input A should be a square matrix and B should have the same
% number of rows as A.
% On return the outputs U and Y are such that U is upper triangular
% and U*X=Y is an equivalent linear system to A*X=B.
Y=[];
U=[];

Respuesta aceptada

Image Analyst
Image Analyst el 3 de Mzo. de 2019
Check if A is square
if size(A, 1) == size(A, 2)
To check if size of A equals the size of B
if isequal(size(A), size(B))
To check if "B should have the same number of rows as A":
if size(A, 1) == size(B, 1)
  3 comentarios
Image Analyst
Image Analyst el 7 de Mzo. de 2019
Try input() or inputdlg(). Unfortunately there is no way that I know of, after 40 years of MATLAB development to conveniently enter a matrix. You'd think there would be, but no, there in no inputMatrix() function (yet).
shoaib Ch
shoaib Ch el 11 de Mzo. de 2019
thanx but i have one more question that what about U , X and Y ??is X be inveraA *B or identity Matrix

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by