Matlab Matrcies in output interact with each other

2 vues (au cours des 30 derniers jours)
Ted Devine
Ted Devine le 10 Août 2021
Réponse apportée : KSSV le 10 Août 2021
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 commentaires
the cyclist
the cyclist le 10 Août 2021
What's your question?
Ted Devine
Ted Devine le 10 Août 2021
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

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 10 Août 2021
fprintf('Mat1 = \n')
disp(Mat1)
fprintf('Mat2 = \n')
disp(Mat2)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by