what's wrong with this code?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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
Answers (1)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!