I need to plot the following script. But it gives an error.

조회 수: 1 (최근 30일)
Ruslan Aslanov
Ruslan Aslanov 2021년 11월 28일
댓글: Ruslan Aslanov 2021년 11월 28일
I think the problem is that we can't divide 1 by 0 so the column "Fw=1/(cos(w*Hs/Vs_soil));" gives an error.
close all
clear all
%properties of rocks
Vs_soil=170;
Psoil=1.5;
Hs=70;
Vs_rock=1000;
Prock=2.4;
damp=0;
%impedance ratio
IC=((Prock*Vs_rock)/(Psoil*Vs_soil));
%Ground fundamental frequency
f0=Vs_soil/(4*Hs);
%Maximum magnification for one dimensional monolayer
% A0=1/((1/IC)+0.5*pi*damp);
%harmonic frequencies
d=10;
dx=1/d;
n=-0.5:dx:5.4;
fn=(2*n+1)*f0;
%Magnification / Resonant frequency
w=2*pi*fn;
Fw=1/(cos(w*Hs/Vs_soil));
%Let's draw the magnification graph
plot(fn,Fw);
title('magnification graph');
xlabel('f(Hz)');
ylabel('magnification F(w)');
legend('Transfer Function');

채택된 답변

VBBV
VBBV 2021년 11월 28일
close all
clear all
%properties of rocks
Vs_soil=170;
Psoil=1.5;
Hs=70;
Vs_rock=1000;
Prock=2.4;
damp=0;
%impedance ratio
IC=((Prock*Vs_rock)/(Psoil*Vs_soil));
%Ground fundamental frequency
f0=Vs_soil/(4*Hs);
%Maximum magnification for one dimensional monolayer
% A0=1/((1/IC)+0.5*pi*damp);
%harmonic frequencies
d=10;
dx=1/d;
n=-0.5:dx:5.4;
fn=(2*n+1)*f0;
%Magnification / Resonant frequency
w=2*pi*fn;
Fw=1./(cos(w*Hs/Vs_soil));
%Let's draw the magnification graph
plot(fn,Fw);
title('magnification graph');
xlabel('f(Hz)');
ylabel('magnification F(w)');
legend('Transfer Function');
use the element wise matrix operator

추가 답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 11월 28일
Fw=1./(cos(w*Hs/Vs_soil));

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by