Workspace calculation accuracy 7 characters
1 回表示 (過去 30 日間)
古いコメントを表示
Hello! Faced a problem, I need to copy the numbers 7 and more characters for later work in text formats
format long g
digitsOld = digits(20);
a = 20.224124124124;
b = 7664555.5789;
x1 = double(y)/b;
x2 = exp(double(x1));
x3 = 5*sin(x2)-pi/2;
x4 = 10*sin(x2)-pi/2;
Aanswer = x2*a;
Banswer = x4*a;
Canswer=x3*a-1.22;
disp(double(Aanswer))
for j = 1:length(Aanswer)
va = ['Aanswer_',num2str(j)];
eval([vn,'=Aanswer(j)']);
end
I have two problems, the first all my values are written in the workspace and there are a lot of them, can I group them all (create Aanswer 1x30000), the second problem in the workspace they are written only 6 characters (when using edit I can see all the other characters and I would like to save them for future work)
0 件のコメント
採用された回答
Rik
2019 年 8 月 2 日
There is a big difference between the display of values and how they're stored. They aren't stored in a decimal form (maybe with the symbolic toolbox there is an exception), but in binary.
You don't need numbered variables or eval, but you need to learn about the sprintf and fprintf functions if you want to export values to another program.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!