| 5 | 1/1 | 返回列表 |
| 查看: 727 | 回復(fù): 5 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||
[求助]
各位大神們 ,幫幫我看看這個(gè)matlab中的類的構(gòu)造器,不勝感激! 已有1人參與
|
||
|
%af.m這是af類的構(gòu)造器。此處定義了人工魚類的數(shù)據(jù)結(jié)構(gòu) function af=af() af.x=0.5+rand(); af.y=rand(); %af.x=-5.12+10.24*rand(); %af.y=-5.12+10.24*rand(); af.try_number=100; af=class(af,'af'); matlab2011b運(yùn)行后總是提示: Error using class The CLASS function must be called from a class constructor. Error in af (line 8) af=class(af,'af'); 請(qǐng)問各位大神,這樣的問題該怎么解決?非常感謝 |


木蟲 (著名寫手)

木蟲 (著名寫手)

|
大神,我按上面的方法做了,但是又出現(xiàn)了其他錯(cuò)誤,你能幫我看看么? afsa Access to an object's fields is only permitted within its methods. Error in get (line 5) out=af.x; Error in afsa (line 29) afs_x(i)=get(afs{i},'x'); 其中,afsa是主函數(shù),get函數(shù)如下: %get.m此函數(shù)負(fù)責(zé)獲取人工魚的位置x,y的位置 function out=get(af,argin) switch argin case 'x' out=af.x; case 'y' out=af.y; case 'try_number' out=af.try_number; otherwise fprintf('參數(shù)錯(cuò)誤!\n'); end 這樣的錯(cuò)誤怎么解決?非常感激! |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 化學(xué)工程專碩324分,一志愿中國礦業(yè)大學(xué)求調(diào)劑 +7 | 耿耿1314 2026-04-01 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 08生物與醫(yī)藥專碩初試346找調(diào)劑 +5 | dianeeee 2026-04-01 | 6/300 |
|
|
[考研] 08工科275分求調(diào)劑 +13 | AaAa7420 2026-03-31 | 13/650 |
|
|
[考研] 289求調(diào)劑 +21 | 新時(shí)代材料 2026-03-27 | 23/1150 |
|
|
[考研] 320分,材料與化工專業(yè),求調(diào)劑 +14 | 一定上岸aaa 2026-03-27 | 18/900 |
|
|
[考研] 350求調(diào)劑 +7 | 阿佳~ 2026-03-31 | 7/350 |
|
|
[考研] 086000生物與醫(yī)藥298調(diào)劑求助 +4 | 元元青青 2026-03-31 | 6/300 |
|
|
[考研] 土木304求調(diào)劑 +5 | 兔突突突, 2026-03-31 | 6/300 |
|
|
[考研] 0805求調(diào)劑 +6 | 是水分 2026-03-31 | 6/300 |
|
|
[考研] 一志愿華東師范大學(xué)有機(jī)化學(xué)專業(yè),初試351分,復(fù)試被刷求調(diào)劑! +9 | 真名有冰 2026-03-29 | 10/500 |
|
|
[考研] 一志愿哈爾濱工業(yè)大學(xué)材料與化工方向336分 +13 | 辰沐5211314 2026-03-26 | 13/650 |
|
|
[考研] 南京大學(xué)化學(xué)調(diào)劑 +11 | 景隨風(fēng) 2026-03-29 | 16/800 |
|
|
[考研] 吉大生物學(xué)326分求調(diào)劑 +3 | sunnyupup 2026-03-31 | 3/150 |
|
|
[考研]
|
gr哈哈哈 2026-03-28 | 3/150 |
|
|
[考研] 考研調(diào)劑 +5 | Sanmu-124 2026-03-26 | 5/250 |
|
|
[考研] 085602 化學(xué)工程專碩 340分求調(diào)劑 +4 | qianbai11 2026-03-29 | 4/200 |
|
|
[考研] 340求調(diào)劑 +6 | Amber00 2026-03-26 | 6/300 |
|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|
|
[考研] 352分 化工與材料 +5 | 海納百川Ly 2026-03-27 | 5/250 |
|
|
[考研] 324求調(diào)劑 +5 | hanamiko 2026-03-26 | 5/250 |
|