필터 지우기
필터 지우기

How to change Floating Point Control Word (FPCW) in MATLAB?

조회 수: 5 (최근 30일)
Fred
Fred 2015년 9월 3일
편집: bel yon 2020년 8월 15일
Hello All,
Does anyone knows how to change Floating Point Control Word (FPCW) in MATLAB, either increase or decrease it?
I'm using MATLAB15a.
Thanks,

답변 (2개)

Walter Roberson
Walter Roberson 2015년 9월 3일
편집: Walter Roberson 2015년 9월 4일
You can find more information about system_dependent on undocumentedmatlab.com .
Note: system_dependent only allows float control in MS Windows.
  댓글 수: 4
Steven Lord
Steven Lord 2020년 8월 12일
bel yon, why do you need or want to change the floating point control word?
bel yon
bel yon 2020년 8월 15일
편집: bel yon 2020년 8월 15일
Thank you for the quick response. It seems that the MATLAB's precision must be only 24, 53 or 64?
I am using the MATLAB COM interface for OpenDSS, where OpenDSS uses 80-bit floating-point values. more detailes in the discussion: https://sourceforge.net/p/electricdss/discussion/861976/thread/d3d147ec/#c3a2

댓글을 달려면 로그인하십시오.


Fred
Fred 2015년 9월 4일
I have seen the link but I could not quite get what should I do, and also the thing they are doing it in C but I'm using pure Matlab, I need something more like for normal MATLAB users.
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 9월 4일
You will need to be specific about which operating system you are using and which possibilities you want the user to be able to select.
The documentation that I am scanning indicates that the FPCW handles only the x87 FPU calculations, and that these days a lot of calculations are done in SSE and SSE2 instructions which use a different control register http://developer.amd.com/community/blog/2009/07/06/ieee-floating-point-exception-handling-in-windows-os/ . MATLAB calls into highly optimized libraries for larger calculations, and those optimized libraries are likely to be using SSE* or whatever post-x87 they can leverage because x87 performance is not scalable. If you adjust the FPCW you run into the possibility that the output behavior you see will depend upon the size of your data in ways that are not intuitive, with "small" calculations being affected (because they might run on x87) and "big" calculations not being affected (because they run on higher performance architectures, possibly even GPUs.)
Steven Lord
Steven Lord 2015년 9월 4일
If you're using "pure Matlab[sic]" then you shouldn't really NEED to fiddle with the FPCW. What is your use case for doing so?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by