Need Matlab program to find out coordinates in finline taper

Status
Not open for further replies.

evoplus

Member level 1
Joined
Dec 28, 2004
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
341
eig,jpower

Hi everyone,

I'm currently trying to design a matlab program to find out the coordinates for each points of a single exponential finline taper structure. Could anyone gives me some pointers as i have tried to include this equation but it keeps giving me error even though i have defined all the paramters, w1,w2,l,L?

w(l)=w2+(w1-w2)(1-l/L)^2.5

Thanks
 

Re: Question for matlab

I guess you have defined l as an array and you have to use ./ instead of / and .^ instead of ^.

Hope this helps
BRM
 

Re: Question for matlab

this is the means of Arithmetic Operators / ^
hope useful
Happy new year

/ Slash or matrix right division. B/A is roughly the same as B*inv(A). More precisely, B/A = (A'\B')'. See \.
./ Array right division. A./B is the matrix with elements A(i,j)/B(i,j). A and B must have the same size, unless one of them
^ Matrix power. X^p is X to the power p, if p is a scalar. If p is an integer, the power is computed by repeated squaring. If the integer is negative, X is inverted first. For other values of p, the calculation involves eigenvalues and eigenvectors, such that if [V,D] = eig(X), then X^p = V*D.^p/V.If x is a scalar and P is a matrix, x^P is x raised to the matrix power P using eigenvalues and eigenvectors. X^P, where X and P are both matrices, is an error.
.^ Array power. A.^B is the matrix with elements A(i,j) to the B(i,j) power. A and B must have the same size, unless one of them is a scalar.
 

Re: Question for matlab

There is no need to use a .^ before 2.5 because 2.5 is a number and not an array.
 

Re: Question for matlab

Hi evoplus,

1) haven't you included the * (multiplicaton) operator?
w(l)=w2+(w1-w2)*(1-l/L)^2.5

2) is w an array and "l" an integer subscript?

Regards

Z
 

Re: Question for matlab

Hi Zorro,

In the matlab, I have included the * sign in the equation. As for l, I'm supposed to use from 0 to 9 value with each increment of 0.2. The ^ sign from my knowledge is for the power sign. Therefore by right, my value of w(l) shld be in a matrix form right?
 

Question for matlab

Hi evoplus,

Yes, but "l" in w(l) is interpreted as subscript.
This should give the expected result (w2, w1 and L are scalar):

l=[0:0.2:9];
w=w2+(w1-w2)*(1-l/L).^2.5;

The resulting "w" is a vector of the same size as "l".
Regards

Z
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…