[MATLAB调试笔记]Update magnetic field in one step
生活随笔
收集整理的這篇文章主要介紹了
[MATLAB调试笔记]Update magnetic field in one step
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
function [field] = bfield(field,prm)% Update magnetic field in one stepX2 = prm.X2;f = field; % reference to Field objf.by(X2) = f.by(X2) + f.ez( X2) - f.ez(X2-1);f.bz(X2) = f.bz(X2) - f.ey(X2+1) + f.ey(X2 );f.by(prm.nxp2)= f.by(2);%對稱邊界條件f.bz(prm.nxp2)= f.bz(2);f.by(1) = f.by(prm.nxp1);f.bz(1) = f.bz(prm.nxp1);
end
>> prm.X2ans =Columns 1 through 162 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17Columns 17 through 3218 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33Columns 33 through 4834 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49Columns 49 through 6450 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65Columns 65 through 8066 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81Columns 81 through 9682 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97Columns 97 through 11298 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113Columns 113 through 128114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129>> f.by(X2)ans =00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>> f.ez( X2)ans =00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000>> f.by(X2) = f.by(X2) + f.ez( X2) - f.ez(X2-1)f = Field with properties:ex: [130×1 double]ey: [130×1 double]ez: [130×1 double]by: [130×1 double]bz: [130×1 double]rho: [130×1 double]ajx: [130×1 double]ajy: [130×1 double]ajz: [130×1 double]>> f.by(X2) = f.by(X2) + f.ez( X2) - f.ez(X2-1)f = Field with properties:ex: [130×1 double]ey: [130×1 double]ez: [130×1 double]by: [130×1 double]bz: [130×1 double]rho: [130×1 double]ajx: [130×1 double]ajy: [130×1 double]ajz: [130×1 double]>> f.bz(X2) = f.bz(X2) - f.ey(X2+1) + f.ey(X2 )f = Field with properties:ex: [130×1 double]ey: [130×1 double]ez: [130×1 double]by: [130×1 double]bz: [130×1 double]rho: [130×1 double]ajx: [130×1 double]ajy: [130×1 double]ajz: [130×1 double]>> bfield(field,prm)
Unrecognized function or variable 'bfield'.Did you mean:
>> field(field,prm)
Unable to use a value of type Field as an index.>> bfield(field,prm)ans = Field with properties:ex: [130×1 double]ey: [130×1 double]ez: [130×1 double]by: [130×1 double]bz: [130×1 double]rho: [130×1 double]ajx: [130×1 double]ajy: [130×1 double]ajz: [130×1 double]>>
總結(jié)
以上是生活随笔為你收集整理的[MATLAB调试笔记]Update magnetic field in one step的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 伴随我成长的编程书,赶紧收藏!!
- 下一篇: 为什么Python不支持 i ++ 语法