matlab - Might be growing inside the loop. Consider Prealocating for Speed -


clear k_1 = 37.6; miu_1 = 41; den = 2.7; n = 100; n=1; phi(1)=1; n=1:n phi(n)= 0.3*(n/n); k_s(n)= k_1*(1-(1+(3*k_1)/(4*miu_1))*phi(n)); miu_s(n)= miu_1*(1-(1+(3*k_1)/(4*miu_1))*phi(n)); den1(n)=den*(1-phi(n)); vp(n)=sqrt((k_s(n)+(4/3)*miu_s(n))/den1(n)); end figure(1); plot(phi,miu_s); figure(2); plot (phi,vp) 

i new on matlab , not know problem code when run program beep buzz , nothing happens. guide me

the reason code doesn't work case sensitivity. using k_1 , k_1, , k_s , k_s (unless intentional). when change that, code compiles ok.

clear k_1 = 37.6; miu_1 = 41; den = 2.7; n = 100; n=1; phi(1)=1; n=1:n phi(n)= 0.3*(n/n); k_s(n)= k_1*(1-(1+(3*k_1)/(4*miu_1))*phi(n)); miu_s(n)= miu_1*(1-(1+(3*k_1)/(4*miu_1))*phi(n)); den1(n)=den*(1-phi(n)); vp(n)=sqrt((k_s(n)+(4/3)*miu_s(n))/den1(n)); end figure(1); plot(phi,miu_s); figure(2); plot (phi,vp) 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -