| 6 | 1/1 | 返回列表 |
| 查看: 1807 | 回復(fù): 5 | |||
bme000銀蟲 (小有名氣)
|
[交流]
【求助】如何用matlab讀取文件中帶符號的、帶兩位小數(shù)點的數(shù)字? 已有3人參與
|
|
各位大俠,如何用fread正確讀取.txt文件中帶符號的、帶兩位小數(shù)點的數(shù)字? fid=fopen(‘normal.txt’,‘r’) ref=fread(fid,6,‘?’) 上面的問號應(yīng)該填什么? [ Last edited by bme000 on 2010-6-3 at 10:26 ] |
木蟲 (小有名氣)
Matlab

木蟲 (職業(yè)作家)
|
[a,count]=fread(fid,size,precision) precision(精度) precision(精度)規(guī)定了以浮點數(shù)、整型數(shù)、字符讀出時字節(jié)數(shù)。matlab 的precision(精度)的表達(dá)式與c語言、fortran語言、是一致的。不規(guī)定precision(精度),則字符默認(rèn)為: ucher、則數(shù)值默認(rèn)為:雙精度 。 以下precision(精度)將保證讀出具有一致的體積。 MATLAB C or Fortran Descriphon(精度) 'char' 'char*l' 8 字節(jié)數(shù),字符型 'uchar' 'unsigned char' 8 字節(jié)數(shù) 'schar' 'signed char' 8 字節(jié)數(shù),字符型 'int8' 'integer*1' 8 字節(jié)數(shù),整型數(shù) 'intl6' 'integer*2' 16 字節(jié)數(shù),整型數(shù). 'int32' 'integer*4' 32 字節(jié)數(shù),整型數(shù). 'int64' 'integer*8' 64 字節(jié)數(shù),整型數(shù) 'uint8' 'integer*l' 8 字節(jié)數(shù) 'uintl6' 'integer*2' 16 字節(jié)數(shù) 'uint32' 'integer*4' 32 字節(jié)數(shù) 'uint64' 'integer*8' 64 字節(jié)數(shù) 'float32' 'real*4' 浮點數(shù), 32 字節(jié)數(shù) 'float64' 'real*8' 浮點數(shù), 32 字節(jié)數(shù) 以下precision(精度)規(guī)定讀出指定的體積n。 'bitN' N字節(jié)數(shù),整型數(shù) 1<=N<=64 'ubitN' N字節(jié)數(shù), 1<=N<=64 所以你說的?那里填的是精度,這個就看你自己處理數(shù)據(jù)的要求填寫了 |

銀蟲 (小有名氣)
|
下面是前四行的數(shù)據(jù) +42.55 +25.16 +18.75 +48.13 +41.53 +38.49 +18.52 +15.51 +83.34 +49.25 +36.89 +91.49 +76.28 +70.85 +32.63 +30.43 +61.87 +32.98 +21.13 +65.51 +52.10 +48.14 +21.58 +22.39 +58.68 +32.93 +18.30 +65.38 +54.93 +49.61 +33.80 +27.73 ~~ |
木蟲 (小有名氣)
Matlab

木蟲 (小有名氣)
Matlab

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 298求調(diào)劑 +3 | 什么是胖頭魚 2026-03-30 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 材料科學(xué)與工程調(diào)劑 +5 | 深V宿舍吧 2026-03-30 | 5/250 |
|
|
[考研] 367求調(diào)劑 +3 | 芋泥啵啵… 2026-03-28 | 3/150 |
|
|
[考研] 材料與化工272求調(diào)劑 +21 | 阿斯蒂芬2004 2026-03-28 | 21/1050 |
|
|
[考研] 318求調(diào)劑 +7 | 陳晨79 2026-03-30 | 7/350 |
|
|
[考研] 0703一志愿9,初試成績:338,四六級已過,有科研經(jīng)歷,求調(diào)劑! +5 | Zuhui0306 2026-03-25 | 5/250 |
|
|
[考研] 290求調(diào)劑 +3 | dfffsar 2026-03-29 | 3/150 |
|
|
[考研] 086000生物與醫(yī)藥調(diào)劑 +5 | Feisty。 2026-03-28 | 9/450 |
|
|
[考研] 0856求調(diào)劑 +13 | zhn03 2026-03-25 | 14/700 |
|
|
[考研] 283求調(diào)劑 +3 | A child 2026-03-28 | 3/150 |
|
|
[考研] 266分,求材料冶金能源化工等調(diào)劑 +7 | 哇呼哼呼哼 2026-03-27 | 9/450 |
|
|
[考研] 08開頭275求調(diào)劑 +4 | 拉誰不重要 2026-03-26 | 4/200 |
|
|
[考研] 324求調(diào)劑 +5 | hanamiko 2026-03-26 | 5/250 |
|
|
[考研] 總分322求生物學(xué)/生化與分子/生物信息學(xué)相關(guān)調(diào)劑 +5 | 星沉uu 2026-03-26 | 6/300 |
|
|
[考研] 085601求調(diào)劑總分293英一數(shù)二 +4 | 鋼鐵大炮 2026-03-24 | 4/200 |
|
|
[考研] 一志愿天津大學(xué)339材料與化工求調(diào)劑 +3 | 江往賣魚 2026-03-26 | 3/150 |
|
|
[考研] 318求調(diào)劑 +3 | plum李子 2026-03-23 | 3/150 |
|
|
[考研] 生物學(xué)學(xué)碩求調(diào)劑 +7 | 小羊睡著了? 2026-03-23 | 10/500 |
|
|
[考研]
|
黃粱一夢千年 2026-03-24 | 3/150 |
|
|
[考研] 277分求調(diào)劑,跨調(diào)材料 +3 | 考研調(diào)劑lxh 2026-03-24 | 3/150 |
|