Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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);

Akzeptierte Antwort

Avni Agrawal
Avni Agrawal am 10 Mai 2024
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.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by