unable to plot graph as well as form a table as it is taking only last value of the loop,plz help me in this particular matter as i ve my submission on coming friday
Show older comments
Y1 =
7.7054
Y2 =
9.6584
I(1)= -0.0159
I(2)=-0.0128
I(3)=-0.0043
I(4)=0.4141
I(5)=0.2673
I(6)=-0.0043
for y=0.45:-0.05:0.25
ud=(I(3)*exp(Y2*y)+I(4)*exp(-Y2*y)+k2)^0.5;
taub=(f*ro*ud^2)/8;
end
for y=0.25:-0.05:0
ud=(I(1)*exp(Y1*y)+(I(2)*exp(-Y1*y))+k1)^0.5;
taub=(f*ro*ud^2)/8;
end
for y=0.0:-0.05:-0.25
ud=(I(1)*exp(-Y1*y)+(I(2)*exp(Y1*y))+k1)^0.5;
taub=(f*ro*ud^2)/8;
end
for y=-0.25:-0.05:-0.45
ud=(I(3)*exp(-Y3*y)+I(4)*exp(Y3*y)+k2)^0.5;
taub=(f*ro*ud^2)/8;
end
table1=[y,ud]; table2=[y,taub]; fid1=fopen('depth averaged value.txt','w'); fid2=fopen('boundary shear.txt','w'); fprintf(fid1,' m m/s \n'); fprintf(fid1,'%8.2f %8.2f\n',table1); fprintf(fid2,' m N/m^2 \n'); fprintf(fid2,'%8.2f %8.2f\n',table2); fclose(fid1); fclose(fid2); plot(y,ud)
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!