Matlab to VB6


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Matlab to VB6

Hybrid View

  1. #1
    Join Date
    Aug 2004
    Location
    Oran (Algeria)
    Posts
    21

    Matlab to VB6

    Hello,

    Need Help to translate short code from Matlab to VB6,
    the code contain numerical computing, Gradient and Hessian Matrix.

    Regards,
    Maritime

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    What is the code that needs translating?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Aug 2004
    Location
    Oran (Algeria)
    Posts
    21

    Red face Matlab to VB6

    Hello,

    ML(1, 1) = 3.27419030768864
    ML(1, 2) = 1.67217103086368
    ML(1, 3) = 0.77642827451032
    ML(2, 1) = 1.67217103086368
    ML(2, 2) = 1.56451953051059
    ML(2, 3) = 1.22506096105216
    ML(3, 1) = 0.77642827451032
    ML(3, 2) = 1.22506096105216
    ML(3, 3) = 3.48985429950068

    VL(1) = 2.84044604335216
    VL(2) = 2.09345971197122
    VL(3) = 3.15558646083793



    I need to translate this pat of code:

    Code:
     
     while (norm(dF,2)>=1e-12)&(m<1000)
     
     S=dot(Vi,Vi)-1;
     dF=2*(ML+2*b*S*eye(3,3))*Vi-2*VL
     ddF=2*(ML+2*b*S*eye(3,3))+8*b*(Vi*Vi')
     m=m+1
     dV=-inv(ddF)*dF
     Vi=Vi+dV
     end



    This is result from matlab:

    donc ta matrice ML c'est celle la
    ML =

    3.274190307688642 1.672171030863679 0.776428274510320
    1.672171030863679 1.564519530510586 1.225060961052163
    0.776428274510320 1.225060961052163 3.489854299500683

    >> VL

    VL =

    2.840446043352157
    2.093459711971220
    3.155586460837926
    V0

    Vi =

    1
    1
    1
    le b
    b=
    4.328564137699911

    In this loop we do S, dF, ddF
    S=dot(Vi,Vi)-1;
    dF=2*(ML+2*b*S*eye(3,3))*Vi-2*VL
    ddF=2*(ML+2*b*S*eye(3,3))+8*b*(Vi*Vi')

    at the first itération:
    S =

    2

    dF =

    40.393200241020260
    39.365096722509705
    39.300027250049766

    ddF =

    75.805406818575861 37.972855163326649 36.181369650619928
    37.972855163326649 72.386065264219752 37.078635023703612
    36.181369650619928 37.078635023703612 76.236734802199948

    donc le Vi que tu retrouves c'est
    Vi =

    0.722525144159246
    0.731431659439092
    0.746808943305029

    et le dV

    >> dV

    dV =

    -0.277474855840754
    -0.268568340560908
    -0.253191056694971

    le Vi final vaut
    Vi =

    0.670836406672209
    0.041286954641636
    0.740460615214353

    done after 12 iterations proximately,

    I am sorry for the comments in French !


    Regards,

    Maritime

Similar Threads

  1. accessing matlab from vb.net
    By pfaisalbe in forum .NET
    Replies: 1
    Last Post: 05-05-2009, 12:26 PM
  2. Matlab and J2ME
    By Hasnain in forum Java
    Replies: 1
    Last Post: 03-25-2006, 03:40 AM
  3. Replies: 0
    Last Post: 02-08-2006, 08:16 PM
  4. calling matlab
    By the_bee in forum Java
    Replies: 1
    Last Post: 01-16-2006, 12:20 PM
  5. Using ActiveX to include Matlab
    By Aaron in forum C++
    Replies: 0
    Last Post: 11-10-2001, 06:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center