decimal places in a string
    18 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I have a very lengthy string (part is shown below) that has 4 columns, and I want all of the numbers to have 9 decimal places. 
"empty"	   "empty"	       "empty"	    "empty"
"43.0842"    "40.8172"	"0.75196"     "0.71239"
"43.0906"    "40.81"	        "0.75207"     "0.71227"
"empty"	    "empty"	"empty"	     "empty"
"37.3686"    "70.4119"	"0.65221"    "1.2289"
"empty"	    "empty"	 "empty"	    "empty"
"37.0861"    "70.8389"	 "0.64727"    "1.2364"
0 件のコメント
採用された回答
  Star Strider
      
      
 2019 年 3 月 1 日
        Your numbers likely retain thier full internal precision, so specify the output format as something like this: 
strmtx = compose("%.9f", rand(6,4));
Make appropriate changes to work with your matrix.  
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で LaTeX についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!