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

1 Ansicht (letzte 30 Tage)
Ruslan Aslanov
Ruslan Aslanov am 28 Nov. 2021
Kommentiert: Ruslan Aslanov am 28 Nov. 2021
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');

Akzeptierte Antwort

VBBV
VBBV am 28 Nov. 2021
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

Weitere Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 28 Nov. 2021
Fw=1./(cos(w*Hs/Vs_soil));

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by