what's wrong with this code?
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
Hi,i have an array named sumNy. the content of sumNy gives me Ny and the number of it's cells show me corresponding accelerations. now i have a specified Ny that is between two Ny s in my sumNy array, and i want to obtain it's corresponding acceleration.
i wrote this code but i dont know why it is not working and it gives me y=0 !
for i=1:150
if i==1
y=0;
elseif sumNy(1,i-1)<=(1/475) & sumNy(1,i)>=(1/475)
y=(((1/475)-sumNy(1,i))/(sumNy(1,i-1)-sumNy(1,i)))*(i-1)+(1-(((1/475)- sumNy(1,i))/(sumNy(1,i-1)-sumNy(1,i))))*(i);
end
end
i must say that (1/475) is my specified Ny and there is two Ny s in my array that the specified Ny (1/475) place between them, so that is not why everytime i run this code it gives me y=0 !
please help me
Thanks
Réponses (1)
Arman Kam
le 26 Juil 2012
0 votes
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!