필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by