简体   繁体   中英

convertting equation to matlab /octave

I have an equation I tried converting to matlab/octave but keep getting a mapping function error. Can some tell me what I'm doing wrong. The equation is below.

Thanks

在此处输入图片说明

The matlab/octave code below is

fs=44100; %sampling frequency
t=(0:10*fs)/fs; %Time vector
alpha=1.1513;
siga1=cosh*(400*pi*j*(cosh*(alpha*t)-sinh*(alpha*t))/alpha);
siga2=sinh*(400*pi*j*(cosh*(alpha*t)-sinh*(alpha*t))/alpha);
sigb=siga1-siga2;

The hyperbolic sine and cosine are functions and you are treating them as variables.

This should work (as long as you have j defined somewhere)

fs=44100; %sampling frequency
t=(0:10*fs)/fs; %Time vector
alpha=1.1513;
siga1=cosh(400*pi*j*(cosh(alpha*t)-sinh(alpha*t))/alpha);
siga2=sinh(400*pi*j*(cosh(alpha*t)-sinh(alpha*t))/alpha);
sigb=siga1-siga2;

I have not worked on MATLAB for 2 years,but i believe your functions must be like this :

siga1=cosh(400*pi*j*(cosh*(alpha*t)-sinh(alpha*t))/alpha); 
siga2=sinh(400*pi*j*(cosh*(alpha*t)-sinh(alpha*t))/alpha);

Can you give me a feedback after you try it ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM