フィルターのクリア

Matlab Matrcies in output interact with each other

1 回表示 (過去 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 Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by