Question: convert this Matlab code to Visual basic code please g = 9.81 m= 80 c=10 tinitial=0 tfull=20 dt=2 vinitial= -20 tchan= 10 cchan= 50 np=

convert this Matlab code to Visual basic code please

g = 9.81

m= 80

c=10

tinitial=0

tfull=20

dt=2

vinitial= -20

tchan= 10

cchan= 50

np= (tfull-tinitial)/dt

t= tinitial

v= vinitial

tout(1)=t

vout(1)=v

for i=1:np

if t

accn=g-c/m*v;

else

accn=g-cchan/m*v

end

v=v+accn*dt;

t=t+dt;

tout(i+1)=t;vout(i+1)=v;

end

plot(tout,vout)

z=[tout;vout]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!