📄 vtb8_3
字号:
function VTB8_3(node,x,zero,ncon,p,f)if nargin==0 disp(' No arguments have been entered.') disp(' Please load configuration data from file.') filename=input('Enter name of file. ','s'); eval(['load ',''filename'','.con']); eval(['load ',''filename'','.eqn']); eval(['load ',''filename'','.out']);endndof=size(node);ndof=ndof(1)*3;mn=1;xx=x;hold offaxis('square')scale=1;nmodes=size(xx);nmodes=nmodes(2);if nmodes>1 flag=1; else flag=0;endfor ii=1:1000 for jj=1:1000 clc disp('') if flag==1 msg1=['Present mode number is: ' num2str(mn) ' of ' num2str(nmodes)]; disp(msg1) end msg2=['Present natural frequency is: ' num2str(f(mn)/2/pi) ' Hz (' num2str(f(mn)) ' rad/s)']; disp(msg2) msg2=['Present scale factor is: ' num2str(scale)]; disp(msg2) disp('') disp('') disp('Select settings.') if flag==0 disp('Only one deformation found.') disp('Selection a is disabled.') end disp('') disp(' a) Select Mode Number') disp(' b) Scale Deformation') disp(' c) Plot Deformation') disp(' d) Exit') answer=input('Enter Choice: ','s'); if answer=='d' | answer=='c' break end if answer=='a' & flag==1 clc mnold=mn; mn=input('Enter mode number: '); if mn <1 | mn>nmodes disp('That mode doesn''t exist. Try again.') mn=mnold; end end if answer=='b' clc scale=input('Enter scale factor: '); end end xx; if answer=='d' break end x=xx(:,mn);% y=zeros(ndof,1);% y(p)=x;x=y; for i=1:length(x)/3 for j=1:2 d(i,j)=node(i,j)+scale*x(i*3-3+j); end end length=max([max([node(:,1);d(:,1)])-min([node(:,1);d(:,1)]) max([node(:,2);d(:,2)])-min([node(:,2);d(:,2)])]); xl=(max([node(:,1);d(:,1)])+min([node(:,1);d(:,1)]))/2-.7*length; xh=(max([node(:,1);d(:,1)])+min([node(:,1);d(:,1)]))/2+.7*length; yl=(max([node(:,2);d(:,2)])+min([node(:,2);d(:,2)]))/2-.7*length; yh=(max([node(:,2);d(:,2)])+min([node(:,2);d(:,2)]))/2+.7*length; hold off clg axis([xl xh yl yh]) plot(node(:,1),node(:,2),'*b') hold on plot(d(:,1),d(:,2),'or') ncons=size(ncon); for i=1:ncons(1) plot([node(ncon(i,1),1) node(ncon(i,2),1)],[node(ncon(i,1),2) node(ncon(i,2),2)],'--b') end for i=1:ncons(1) plot([d(ncon(i,1),1) d(ncon(i,2),1)],[d(ncon(i,1),2) d(ncon(i,2),2)],'r') end tinm1=['Mode ', num2str(mn)]; tinm2=[', ' num2str(f(mn)/2/pi) , 'Hz']; titlename=[tinm1 tinm2]; title(titlename)end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -