Results 1 to 2 of 2

Thread: Matlab

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Feb:2011
    Location:
    Posts: 54

    Matlab

    Matlab, .

    k=input ( ' k= ');
    n=input ( ' - n= ') ;
    V=input ( ' [ , , , . . .] ');
    V
    if k>0
    for i=1:n
    if V(i)<k&V(i)>0
    NV(i)=V(i)+i+k;
    end
    if V(i)<0
    NV(i)=V(i) *k;
    end
    end
    else
    for i=1:n
    if V (i)>k&V(i)<0
    NV(i)=V(i) *k;
    end
    if V(i)<k
    NV(i)=V(i)+i+k;
    end
    end
    end
    NV
    br=0;
    for i=1:length(NV)
    if NV(i)<=-5 | NV(i)>=2 | NV(i)~=0
    br=br+1;
    end
    end
    disp([ ' = ' ,num2str(br)]);


  2. #2
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    Quote Originally Posted by as3n View Post
    (10b) || !(10b)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |