필터 지우기
필터 지우기

how to call two non-empty square matrixes?

조회 수: 1 (최근 30일)
shoaib Ch
shoaib Ch 2019년 3월 3일
편집: shoaib Ch 2019년 4월 2일
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=[];

채택된 답변

Image Analyst
Image Analyst 2019년 3월 3일
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
Image Analyst
Image Analyst 2019년 3월 7일
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 2019년 3월 11일
thanx but i have one more question that what about U , X and Y ??is X be inveraA *B or identity Matrix

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by