how to plot extracted mode shapes in MATLAB?

87 Views Asked by At

I used next MATLAB code to find out mode shapes vectors and corresponding natural frequencies for cantilever plate. where the mass and stiffness matrices are obtained from ANSYS software.

clc;
clear all;
format shortG;
format loose;

load matK_MMF.txt;
K = zeros(462,462);
for r = 2:5515
    K(matK_MMF(r,1), matK_MMF(r,2)) = matK_MMF(r,3);
end
disp (K)

load matM_MMF.txt;
M = zeros(462,462);
for r = 2:1999
    M(matM_MMF(r,1), matM_MMF(r,2)) = matM_MMF(r,3);
end
disp(M)

cheq=linsolve(M,K)

[Mode,Lamda]=eig(cheq);

lamda=diag(sort(diag(Lamda),'ascend')); % make diagonal matrix out of sorted diagonal values of input 'Lamda'
[c, ind]=sort(diag(Lamda),'ascend'); % store the indices of which columns the sorted eigenvalues come from 'lamda'
omegarad=sqrt(lamda);
omegaHz=omegarad/pi/2
mode=Mode(:,ind)

I tried to use next code

v1=Mode(:,1)
    plot(v1(:,1))
    
     v2=Mode(:,2)
    plot(v2(:,1))
    
     v3=Mode(:,3)
    plot(v3(:,1))
    
     v4=Mode(:,4)
    plot(v4(:,1))

but the result didn't make any sense, it was just a pulse at certain frequency then I tried to use next code :

bounds = [0 0.2 0 0.1]; & length and width of the plate
figure;

colormap(flipud (hot));

E_one = fsurf(v1,bounds)
set(gca,'FontSize',23);
colormap ;
daspect([1 1 0.1]);
E_one.EdgeColor='k';

It gave me the next error Z must be at least a 2x2 matrix.

0

There are 0 best solutions below