what's wrong with this code?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
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
回答 (1 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!