Making two data appear side-to-side
이전 댓글 표시
I have two variable: array and Sw_C that i need to present side-to-side as in the picture attached and I'm using fprintf to do so
but it seems like something is wrong in the fprintf that I'm using at LINE 19. Hope my question make sense and clear to you and please help me to check and correct it. Thank you. The excel data is attached here as well.
*note that in the Rt data in the picture is defined as variable "array" in the script to avoid any confusion
syms Sw
format short
p=0.153;
Qv=0.980;
Rw=0.265;
m=1.86;
B=3.2;
n=2.2;
array=xlsread('watersat','Sheet1','A2:A45');
Sw_Lab=xlsread('watersat','Sheet1','B2:B45');
for i=1:length(array)
Rt=array(i);
eq=Sw==(Rw./((p^m)*Rt.*(1+(B*Qv*Rw)/Sw))).^(1/n);
sol=vpasolve(eq,Sw);
a(i)=sol;
end
Sw_C=a';
fprintf('\n%2.4s\t%2.4s\n','array','Sw_C');
fprintf('%2.4f\t%2.4f\n',array,Sw_C)

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Newton-Raphson Method에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!