フィルターのクリア

Matrix must be square error and Error in PartA. how do I solve it?

1 回表示 (過去 30 日間)
Trong Nhan Tran
Trong Nhan Tran 2024 年 5 月 10 日
回答済み: Avni Agrawal 2024 年 5 月 10 日
clc; % Clear command window
clear; % Clear workspace
syms w; % Define w as a symbolic variable
% Define masses, damping coefficients, and stiffness coefficients
m1 = 1.8; m2 = 6.3; m3 = 5.4; m4 = 22.5; m5 = 54;
c2 = 10000; c3 = 500; c4 = 1500; c5 = 1100;
k2 = 1*10^8; k3 = 50*10^3; k4 = 75*10^3; k5 = 10*10^3;
B = [k2+c2, -k2-c2+(m2*w^2), 0, 0, 0;
-k2-c2, k2+c2+k3+c3, -k3-c3, 0, 0];
detB = det(B);
Error using sym/det (line 24)
Matrix must be square.
Error in PartA (line 23)
detB = det(B);

採用された回答

Avni Agrawal
Avni Agrawal 2024 年 5 月 10 日
I understand that you are trying to find the determinant of matrix B. But, The determinant is a scalar value that can be computed from the elements of a square matrix and encodes certain properties of the matrix. For a non-square matrix, since the number of rows and columns is different, the concept of a determinant does not apply.
Please take a look at this documentation for better understanding: https://www.mathworks.com/help/matlab/ref/det.html
I hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by