Results 1 to 2 of 2

Math Help - MATLAB function help

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    1

    MATLAB function help

    Hello every body
    i made a function but i don't know why it dosn't work

    here is the code

    Code:
    function  rezultat=aranjare(rezultat)
    
    
            for i = rezultat.nrc:-1:2
                if (rezultat.cifre(i)>=10)
                    rezultat.cifre(i)=(mod(rezultat.cifre(i),10))
                    transport=((rezultat.cifre(i)-(mod(rezultat.cifre(i),10)))/10)
                    rezultat.cifre(i-1)=(rezultat.cifre(i-1)+transport);
                    i--;
                else
                    i--;
                    
                endif 
            endfor
            if (rezultat.cifre(1)>=10)
                rezultat.cifre(1)=(mod(rezultat.cifre(1),10))
                transport=((rezultat.cifre(1)-(mod(rezultat.cifre(1),10)))/10)    
                aux=zeros(1+rezultat.nrc)(1,:);
                for i = 2:rezultat.nrc
                    aux(i) = rezultat.cifre(i);
                endfor
                rezultat.cifre=aux;
                rezultat.nrc++;
            rezultat.cifre(1)=transport;
            endif
            
    endfunction
    Here is an example of what it should do
    in :
    x.cifre=[33 3 4 55 6 ]
    x.nrc=5
    out
    x.cifre=[3 3 3 9 6 6]
    x.nrc=6
    like the result of an addition of two arrrays .
    Thank's in advance,
    Best regards.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Mar 2010
    Posts
    2

    MATH Lab Fuction

    Hi,
    I have actually been so worried that i cant get anybody to to talk about MATHLAB in this forum.I bought the software long ago,but cant really make a meaning utility out of it.

    Sorry i could not help with the challenge you have posted.I even need help on this subject.
    Pls I need help on how to use mathlab,probably tutorials on its usage.Any body with any usefull information should please help me with it.Or better still,my e-mail is awurumnonye@yahoo.com
    Thanks
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. need a matlab function
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 1st 2011, 10:52 PM
  2. Matlab function
    Posted in the Math Software Forum
    Replies: 2
    Last Post: April 17th 2010, 08:11 PM
  3. Please help with MATLAB function
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 16th 2010, 04:21 AM
  4. is there any function in MATLAB?
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 4th 2010, 01:57 AM
  5. need help with matlab function
    Posted in the Math Software Forum
    Replies: 2
    Last Post: March 24th 2010, 09:47 AM

Search Tags


/mathhelpforum @mathhelpforum