help-octave
[Top][All Lists]
Advanced

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

Re: plot from m-file doesn`t work


From: pavel . schor
Subject: Re: plot from m-file doesn`t work
Date: Tue, 07 Jul 2009 14:08:13 +0200 (CEST)

Hi, thanks for your help, my problem is solved by adding --persist 
Thanks you very much!
Here is my script, i use it to calculate force on each rivet in case
of simple planar rivet binding:
(calculation work well, but output is not finished)

disp ("Nytove spoje v. 00xx")

disp ("********* ENTER FORCE **********")
FX=input("enter Fx [N] ")
FY=input("enter Fy [N] ")
F=sqrt( (FX^2)+(FY^2) );
disp("force is :"), disp(F)
SFX=input("enter x-coordinate of point of aplication [mm] ")
SFY=input("enter x-coordinate of point of aplication [mm] ")

disp ("********* RIVETS **********")
nn=input("Enter no. of rivets ")
nn=int16 (abs (nn));

for i = 1:nn

   if (i > 1)
   disp("******** RIVET no. ************")
   disp(i)
   disp("****************************")
   pp=input("use material and diameter of last ?? [y/n]  ","s");
      if strcmp (pp, "a");

   NYTY(i,1)=input("enter x-coordinate [mm] ");
   NYTY(i,2)=input("enter y-coordinate [mm]");
   NYTY(i,3)=NYTY((i-1),3);
   NYTY(i,4)=NYTY((i-1),4);
         else


    disp("******** RIVET no. ************")
   disp(i)
   disp("****************************")
   NYTY(i,1)=input("enter x-coordinate [mm] ");
   NYTY(i,2)=input("enter y-coordinate [mm]");
   NYTY(i,3)=input("enter diameter [mm] ");
   NYTY(i,4)=input("enter strenght modulus [MPa] ");
   NYTY(i,3)=pi*(NYTY(i,3)^2)/4;
   NYTY(i,3)=pi*(NYTY(i,3)^2)/4;
      endif

   else
   disp("******** RIVET no. ************")
   disp(i)
   disp("****************************")
   NYTY(i,1)=input("enter x-coordinate [mm] ");
   NYTY(i,2)=input("enter y-coordinate [mm]");
   NYTY(i,3)=input("enter diameter [mm] ");
   NYTY(i,4)=input("enter strenght modulus [MPa] ");
   NYTY(i,3)=pi*(NYTY(i,3)^2)/4;
   endif

endfor

disp(NYTY)




for i = 1:nn
eix(i)=NYTY(i,1)-SFX
eiy(i)=NYTY(i,2)-SFY
endfor
As=(NYTY(:,3))'
Gs=(NYTY(:,4))'
if ( sum(eix) == 0 );
   ex=0
   else
ex=sum(As.*Gs.*eix)/sum(As.*Gs)
endif
if ( sum(eiy) == 0 );
   ey=0
   else
ey=sum(As.*Gs.*eiy)/sum(As.*Gs)
endif

for i = 1:nn
r(i)=( (NYTY(i,1)-ex)^2 + (NYTY(i,2)-ey)^2 )^(1/2);
endfor

for i = 1:nn
FX1(i)=FX*Gs(i)*As(i)/(sum(As.*Gs));
FY1(i)=FY*Gs(i)*As(i)/(sum(As.*Gs));
endfor


for i = 1:nn
if ( r(i) == 0 );
   FX2=0;
   else
FX2(i)=FX*ex*r(i)*Gs(i)*As(i)/sum(As.*Gs.*(r.^2));
endif

if ( r(i) == 0 );
   FY2=0;
   else
FY2(i)=FY*ey*r(i)*Gs(i)*As(i)/sum(As.*Gs.*(r.^2));
endif
endfor

FX=FX1+FX2
FY=FY1+FY2


plot(NYTY(:,1),NYTY(:,2),"o");
disp("end")



Pavel Schor
address@hidden

reply via email to

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