help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script error


From: Dmitri A. Sergatskov
Subject: Re: Script error
Date: Sun, 18 Mar 2018 10:17:31 -0500



On Sun, Mar 18, 2018 at 8:08 AM, Stefano Milani <address@hidden> wrote:

n=(L-2*p1)/p1+1;

​n is double​

 
r(1)=r2-p1*tan(alpha);
for i=1:n
 r(i+1) = r(i) - p1*tan(alpha);
 f(i) = 2*pi*r(i)/p;
end

When I run it I receive this message:

error: r(347): subscripts must be either integers 1 to (2^31)-1 or logicals
error: called from
    pattern at line 17 column 10


But I however obtain series number.
How can I solve this problem? Where I'm wrong?


​n is double, but it "​must be either integers 1 to (2^31)-1 or logicals"

You can do something like n=int32((L-2*p1)/p1+1);


Best regards

_______________
Stefano Milani
Structural Design Specialist
Ener Consulting S.r.l.


​Dmitri.
--
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]