Matlab Matrcies in output interact with each other

조회 수: 2 (최근 30일)
Ted Devine
Ted Devine 2021년 8월 10일
답변: KSSV 2021년 8월 10일
clear
clc
close all
syms x
Mat1 = zeros(10,10);
Mat2 = zeros(10,10);
for j=1:10
for k=1:10
if j+1==k
Mat1(j,k)=sqrt(j);
Mat2(j,k)=-sqrt(j);
end
if k+1==j
Mat2(j,k)=sqrt(k);
Mat1(j,k)=sqrt(k);
end
end
end
disp(Mat1)
disp(Mat2)
  댓글 수: 2
the cyclist
the cyclist 2021년 8월 10일
What's your question?
Ted Devine
Ted Devine 2021년 8월 10일
when i run the code the matrices output as one big blob and combine together. I cant seem to get them to just sty apart

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

답변 (1개)

KSSV
KSSV 2021년 8월 10일
fprintf('Mat1 = \n')
disp(Mat1)
fprintf('Mat2 = \n')
disp(Mat2)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by