data loaded within function shown as NaN

2 ビュー (過去 30 日間)
Kyle
Kyle 2012 年 9 月 20 日
Dear Matlab community,
I have a simple A.m function within which I load a B.mat file with data matrix C containing double formatted entries. There are no issues when I load the B.mat file by itself. However, when I load the B.mat file within the A.m function, entries of C appear as NaN.
The elements of C are 1e-5 and are thus stored with precision. I wonder if this issue has to do with how precision is dealt with when data is called within a function.
Any suggestions would be much appreciated.
Thanks in advance,
Kyle
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 20 日
post your function
Alex
Alex 2012 年 9 月 20 日
what do you get if before loading the .mat file you write "format long" ?

サインインしてコメントする。

回答 (1 件)

Babak
Babak 2012 年 9 月 20 日
Your A.m function (or script) edits/changes the B.mat data. At some point it changes some of the numbers to NaN. If you don't post what A is, people can't help you here.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by