Conversion of double to structure error?

1 次查看(过去 30 天)
Lx=0.286; % length of plate(m)
Lz=0.198; % breadth of plate(m)
xr=linspace(0,Lx,1000);% 1000 x co-ordinate points on surface
zr=linspace(0,Lz,1000); % 1000 z co-ordinate points on surface
[X,Z]=meshgrid(xr,zr);%
m=1:1000;% mode numbers width
combo=[2 2; 2 3; 5 3]; % (n=2,m=2),(n=2,m=3),(n=5,m=3)for eq 90 & 91 notes
psi=zeros(3,length(xr),length(zr));% initalise
freqs=[112 445 850]; % frequency array obtained from eq 91 note(n=2,m=2),(n=2,m=3)&(n=5,m=3)
Vsh=zeros(length(m),3);% initalise video
for k=1:length(combo(:,1))
psi(k,:,:)=sin((combo(k,1)*pi.*X)/Lx).*sin((combo(k,2)*pi.*Z)./Lz);% eq 90 notes
figure
surf(X,Z,squeeze(psi(k,:,:)),'EdgeColor','interp');
xlabel('Length')
zlabel('Displacement')
ylabel('Width')
colorbar
title(['Shape Function',num2str(freqs(k)), 'Hz'])
Vsh(:,k)=getframe(gcf);% save figure to a video frame
end
close all

回答(1 个)

Walter Roberson
Walter Roberson 2019-7-23
编辑:Walter Roberson 2019-7-26
getframe returns a struct not an array of double

Community Treasure Hunt

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

Start Hunting!

Translated by