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!