-
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.
-
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