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 で Operations on Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!