! h. x% A2 [$ ?7 D. _由于图像技术得到了极大的重视和长足的发展,人们需要对它们进行综合研究和集成应用,由此出现了图像工程。图像工程的概念在1982年首先提出,当时主要包括有关图像的理论技术,对图像数据的分析管理以及各种应用。图像工程的内容非常丰富,根据抽象程度和研究方法等的不同,可分为图像处理、图像分析和图像理解三个层次。换句话说,图像工程是既有联系又有区别的图像处理、图像分析及图像理解三者的有机结合,另外还包括它们的工程应用。) F) u, j- |. y& O# @
8 r5 b' J* s: v0 p6 j' KSolution Number: 26990! N6 @ J/ u6 s
1 \2 B9 `- E" |) a; ?' _
Date Last Modified: 2001-01-30 6 U4 i' M: u3 K% d0 q& R8 i2 p$ k, A% _# H4 ]
Product: MATLAB 6.0 ==> Current Version / k! E; ?5 i! \9 u- O: C' r' Y" Q2 X) B
Platform: Windows' I+ V4 u5 a, w' Y$ W
4 J- S P; E) h/ s: Y1 Z9 y9 Q* KProblem Description. e1 M/ h1 H2 ~
& @5 O9 l' \" k' J; y
Why do I encounter problems when running MATLAB 6.0 (R12) on Hebrew 1 I+ ^0 ^& s) O) P% T* ] H* n7 I1 L5 a+ E) z
or : q2 x; N1 c0 o" B+ f# o3 R: s 0 I6 P/ ^; C. a4 J$ RTraditional Chinese (Taiwan) Windows? I try to start MATLAB but after - G& r7 |) E4 q5 Y% N& v! K6 g+ o8 @
the splash screen disappears, MATLAB exits.5 N" ]! x8 x3 Q. A: T
D( P1 ^' W7 ?+ `PLEASE NOTE: This solution only applies to MATLAB 6.0. If you have a3 H# D* k6 z& i) y( Q B, ~* C
8 x: Y' I0 ~% z" G9 ~& N9 zsimilar problem with MATLAB 5.0 or the Student Edition of MATLAB 5.0,. R$ q9 Z3 l, l) e+ G' z; r# l
1 R$ }) o) x3 Z$ c& e# H
see solution 7213. % J3 b* Q% p& m" T2 [( h8 q( y Q" U' R
Solution:( i9 N t! e( c! o; w
+ ~3 P+ R! j4 ]# h" A1 ~This problem is caused by a bug in one of the font properties files we ship" r* {' k1 D) D& k/ J
4 E; R7 E0 v7 Q# n- J n+ @3 qwith MATLAB. The font.properties file is used by Java to map the standard 9 q3 w \. G6 l$ o3 o: I8 R# T& S
Java font names to system fonts for a particular language operating system.; X9 }% o3 J4 ~1 _" E' }
! E, D# o6 H& v5 u$ p7 O& N
However, we made a few assumptions that do not hold for the Hebrew or1 F0 u a% S0 @) B/ Y
% i+ i5 G( l- a* m/ r9 y
Traditional Chinese Windows, causing this problem. " e+ Z5 C' Q4 e! F2 S3 C( q X: I& c6 F( O$ q6 I: {' T
We have created a fixed version of the mwt.jar file that you can use to7 d0 a, @8 _! _% L
+ q. N7 _! P; V4 Ccorrect this. To use the fix, first rename your mwt.jar file as mwt.old. x4 m; a( H0 Z
. I; _4 Y3 l" a1 H. l' y$ r: FThis file is found in the $MATLAB\java\jar directory, where $MATLAB is your " N o# b G) h7 w" M4 I0 k2 f& v& S0 Y& n: T/ S }5 @
MATLAB root directory. Then download the newer mwt.jar file from:0 l% ^' c! J) j$ r
0 L7 W. Y/ v6 i C* L2 P: qftp://ftp.mathworks.com/pub/tech-support/solutions/s26990/ P X! n) S! O4 Y( X( A8 j5 d& m
A& K$ [! V9 u* T0 \
and place it in your $MATLAB\java\jar directrory. Then restart MATLAB; - H5 E1 ~+ F% I* s, G6 v, p$ \9 f3 F6 Y* _1 M# c! Y
this should correct the problem you're seeing. * d4 X9 ?: a0 h3 i3 V4 R8 j r: Y0 X: u0 j1 [
2)我有一组x,y,z值,非规则排列,如何在Matlab中绘图?' }9 F0 M. A4 ~" p( f) `
5 g/ E9 s" }5 O) Q! c3 F# ]:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/12, BigGreen/MathTools #+ |5 p9 J) | @8 l0 m% Z
, y( K* c! x# [" z Q1 H
参见第一节问题7) & c1 ^* X* q5 F. u $ d- T8 r) c1 }6 j0 o3)如何在给定句柄的axis里绘图? & U! f4 r. k' i+ t2 i0 C ; d& ^; y6 O, h3 J; m1 ~:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/12, SMTH/MathTools # # b5 T$ [ ^) a4 U* ~: F/ K1 _$ K4 z Q$ M9 O `- b' L) Z
plot(data,'parent',haxis);; u8 F- K5 i4 ~% Q" U: Z2 |# o
% X) L6 S. h+ J8 e
或者" ?8 z( a1 ~* J/ @
' R. k' I7 U \3 ^7 H1 Yhbar=bar(data); 6 l6 D2 Z. U2 S( N- q * G; b3 q. j+ b$ |set(hbar,'parent',haxis); * R; k; _5 T; H4 p: K' Y3 A9 V# g( l 5 o- G: b" G. l$ M5 }' ^4)由Matlab符号运算得到的公式怎么才能将数据代进去运算?& ]0 E: a& l) S/ B# g- n/ Q9 C1 l
1 T# {/ [5 S5 k/ i' v:#ramjet (德芙)2002/3/3, SMTH/MathTools #4 i, V" Z9 s3 U( H) v
. }; |0 W% V' s3 K, Y
使用subs(),或先将值赋予一个符号变量,然后用eval()1 Q7 _! h' ?* n
! M2 @' x N8 O& N7 }' L. J:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/21, BigGreen/MathTools #' i3 h# n9 {' c% [3 X0 O' X4 o
7 j' f7 U; g9 ?/ c1 r) _即用y=a*x+b来拟合一组数据{{x1,y1},{x2,y2}…{xn,yn}} * k) q* i9 s0 w0 o V. R 3 s- h& M4 x0 cmatlab中使用polyfit0 h+ _8 ^3 |7 I# e
) p! m( ~3 A ex=data(:,1); 0 W; L- s0 y5 b) n0 |* B, H$ g1 z* t8 x! K4 A9 v! C
y=data(:,2);) M2 m# Z/ G1 P3 w
, L2 ?1 S5 e1 P6 Dp=polyfit(x,y,1); 0 `7 |7 g, w" Q" \' @! e & J' ?: u9 v( `p(1)为斜率a,p(2)为截距b ; H; }( v$ u1 w 6 ~: c# t1 `2 P0 z* X P9 x2 f多元线性回归即用y=a1*x1+a2*x2+..+am*xm来拟合数据点{x1i,x2i,…xmi,yi}5 b2 C! a6 q& K; E9 L8 T) [
* h8 l C1 e/ g
(i=1~n): R, f& \& G# g, q. Y! A+ l+ C
# y& d) T! K& j
|x11,x21,…xm1|. D8 N' z; ]6 H+ J# C
# X4 ?' N: w, N" Y; z
A=|x12,x22,…xm2| 2 Z/ H& C+ [/ N% Y' w) e / j0 V _) a# ]; c6 f2 H|…………… |5 f4 i" q/ ^4 m4 s/ Y3 L
! [4 f6 Q# O! u7 \( q# P0 H+ J% q$ e|x1n,x2n,…xmn|, X2 u s0 \+ }- ~3 m) I
* R6 `- j: S. t' j& BY={y1,y2,y3,…,yn}' F! k, X% r7 Y2 ~! b5 \ & N& ^; G B3 O& l' \则系数{a1,a2,…,am}'=pinv(A)*Y ! z. H+ O, L) S B3 t. F8 X" A: b
在matlab中使用3 V0 W; X* N3 L3 n
* B, J2 p- R. Z H
coeff=A\Y, w3 ~8 W V9 N- G0 `& j8 q" v; k
4 e% N5 B( B" {* w @8 b- _则可以得到最小二乘意义上的拟合系数6 @0 q6 S( S- Y) o. A& T d
# f( \+ E7 E& ]/ y( S) {
7)Matlab中如何作圆回归? S8 S! o3 t" T0 S1 C# |4 z; l9 E
5 v& @' V( v7 V/ U- I$ i) c
:#Peter Boettcher (boettcher@ll.mit.edu),2002/5/16, comp.soft-sys.matlab#; b9 s% A& [4 ~! z- Z
) r/ ?* Z) j: v, E2 ~- F) E2 a+ F( e! sQ5.5: How can I fit a circle to a set of XY data? 7 S$ I4 _* @/ G1 N3 S. N 1 L0 @2 ?9 R: O& ?7 {================================================= 4 U( }, [2 G. A; }! f$ ~ ! L/ }* M" E, B5 c# l7 d `An elegant chunk of code to perform least-squares circle fitting was& F: `; Z% _. `
9 q# o6 R4 Y4 z9 h* e" L6 _/ u
written by Bucher Izhak and has been floating around the newgroup for! f( k/ c w3 A- F
, L; u5 R' ^0 T/ bsome time. The first reference to it that I can find is in: 8 h- M) [+ g$ x8 O : q+ n7 {& [4 e5 V8 e; kfunction [xc,yc,R,a] = circfit(x,y)3 \. H: Y0 b2 L. `% |
+ f' [, u$ p( `, T5 d5 R2 O
%CIRCFIT Fits a circle in x,y plane 0 w b' r% @( j* J, o. f* D: G' T & z- E5 o: p; s, S% q. V% 7 Z- z0 r" @9 K E. Z8 _% ] 4 Y1 D' Q8 {( N2 C+ e% [XC, YC, R, A] = CIRCFIT(X,Y) 3 E# W! s2 Q8 X: j/ _/ f' M- Y: t$ N
% Result is center point (yc,xc) and radius R.A is an optional & d7 {% J i; i/ k5 G9 o/ k- T$ ^& t; T3 b% v
% output describing the circle's equation:- t! G* p1 i) G" V0 r% N! ]7 w- a: N
. U, Z0 b2 d# j ]' N* ~Tom Davis provided a more sophisticated approach that works for more 7 w5 x) G |: p9 r2 Y$ i ! O1 u |' m4 _, Ecases in and Code included.+ o+ {9 r+ N( h: s, m& d- Q- }
" T* e& }% |. F6 v2 g# e) Z) A
8)Matlab中如何绘制箭头? @7 T1 P- m% A8 t - B7 z6 b K. Z/ N0 r:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/21, SMTH/MathTools # 5 V! X; b' I3 x2 M" m5 s 9 t! ?. b; Y: `到http://www.mathworks.com/matlabcentral/fileexchange/index.jsp 8 r: X5 U* E+ x6 S4 e' n' Z 5 t4 L$ f4 i3 b: q3 ~0 f. ?2-D Plotting and Graphics中查找arrow.m,或者$ D4 D' V1 u H; f2 {
% R4 p/ y6 b! w9 x7 T参见- Q! a& b: M! E& k/ u/ E
: e' t# u) H8 O http://engineering.dartmouth.edu ... oad/source/Implicit / T" p, x( _' k8 {1 E+ w9 N( Q b/ i9 a
Plot3D.htm ( y" j* z1 a' _. n8 k, P2 C. W4 ]" k! Y) F# I5 f
19)Matlab中什么函数可以删除矩阵的某一行或列?; Z- F7 V$ h- s/ X& N0 y
7 z9 k8 l: ?! C* h! U
:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/21,BigGreen/MathTools #1 ^1 W: [: j: z( g3 X: H. S
* I" b; v& Q @2 u
A(j,=[]; %删除A的第j行+ {% B6 X6 Z+ L7 @
+ i1 Y/ N* L7 p4 g. OA(:,i)=[]; %删除A的第i列4 l$ g/ J6 b1 I
' u- G, u& J, D* W4 [
20)Matlab中能开的最大数组是由什么决定的? ' ~- E( \, |, H! h( g$ \" E+ w ( h0 {4 k, E0 b5 b:# chenft (mike),2002/6/1, SMTH/MathTools #0 a+ h H3 f+ e$ Z. o2 {% z
9 G3 q+ x1 w8 g# S3 L& u4 F: _ M) D( wI have had similar problems. Below is an explanation I received from Ian; W& Y7 a$ }8 q; z+ |; }, X, u
$ `( e k9 w- U: @9 @- G" @8 y
Boyd . J' v! W1 J! b( |4 Y& Q% g' d# E, g
from Mathworks (just giving credit where credit is due) that explains 0 a$ A. z; L8 g7 B% v3 F, G- G; u- y% d7 M$ g/ u
what's happening. You solution is to run matlab with the -nojvm mode. * l1 q1 [( T; l; e' j8 q5 v w+ W2 S1 i% |1 B2 G" b! i& ~; U8 h
"The heap memory system in J***A consists of data and handle elements. 2 {6 L5 C) U5 a0 ~. k0 [ 7 {4 N$ C8 q4 P! P/ I }When you allocate a variable you get a handle and data. As long as data ( ^" K" f% U: z* o H1 G) Y$ g- V" M- T8 V9 T7 ^has an & Y$ U% `1 U) q' p, S2 `5 e E; P, S4 h/ P |! ^
associated handle, the JVM considers it valid and will not clean it up.& D; [! w0 b" a/ T4 m/ L5 J
- p: s+ f0 {+ V' j! IHowever, when you call the clear function in MATLAB, all handles are1 P( s1 F, H& ?. {5 F0 T+ P. t
7 g! a# _: W5 X' G; r3 m1 D
destroyed, and the data associated is now invalid. This means that the, j+ n6 V, c$ x6 P
+ [2 n S, j! l* B9 `J***A 6 `* f i! U6 n/ y* Q( A n; k9 j+ }# M, Y8 t; ?% r
engine can free up that data (garbage collection), but does not mean l8 b& i9 B+ o: M; s& O9 c
" n- \/ O- W2 E7 N+ cthat it will clean it up at that moment.* Q. R( E* }; y2 u
8 r( |3 K7 E" T3 h" K# O, cCalling the PACK command encourages J***A to run the garbage collector 1 y# ^ W# q3 J; O. S3 G4 J : X; L. c, ]. _* o! ^( q+ kand de-fragment the memory. But it does not force it to (This is part5 w, p- L' p: V8 R9 o8 R) q
) j4 q6 S; C6 |" r1 @( i. V
of the J***A design). Even though the memory is 'freed' on the heap," M, |( ~- c8 w
& ^" U- @7 A0 R" c5 E0 i, Fit is not actually free to the OS, it is only free to the JVM. Here 7 J5 I4 d( N! \6 }6 D+ z# [# R7 E( P' g8 y" f4 J0 u
is one way to think of it: / D p x" r% n! g, I + _) ^" ]" L, M( i% ^: L[MATLAB]6 _. l* C# B0 F) Q
4 ~5 ]8 X1 A3 U+ u% m; [ I1 G[J***A]. n' }. f# J. ]$ G- U6 J1 r6 _
/ w, \8 c) T/ ?# g/ w0 s
[OS] 0 X- R* U% p7 @ Q' l' g# O7 i' l0 _; {) T- d, g6 X& _9 Q( s
MATLAB runs on J***A (virtual machine), and Java runs on the OS (physical3 I# J! S5 u, Q7 h
2 e, o8 ^. P0 w7 Fmachine). So when MATLAB is running in J***A mode memory allocations8 f0 I* `& ~0 O) P0 O
( ?5 I4 g$ `3 A/ h0 }9 g$ y
are requested from the JRE, not the OS." C$ P1 W5 ?6 S) r
2 R3 A. d H! t( t7 [9 f6 m
One problem you may be running into is that the default maximum J***A heap 6 x. N9 _( U. d3 V0 ^" p' p9 U) H* z( D! Y* d2 n4 f
size is relatively low ( <= 64 M, so that is all the memory one session; j* f* W# c1 D6 W- c; n
3 m& F& @! ~. B8 \of MATLAB will ever get on your system. 9 w8 H8 M4 z6 l* u ; c2 r; X) {3 f/ _# @) OThe good news is that you can increase this value. You will need to create ' }* f( \( p7 v2 F- H7 l) t& W T- T- \" Z+ w) [
a java.opts file in $MATLAB/bin/$ARCH (or in the current directory when " Y% i' s" o9 \ , U* `9 a* w7 B D# l6 j$ lyou 5 {: Y* f5 O+ T0 P6 l- K8 C+ ~7 o) m3 d+ T- ]' x
start MATLA and put the following command: - B) e2 I. M: {: T1 J# p+ Z1 ^$ r* i9 o" C+ t1 g1 E# U
%%%BEGIN CODE%%% r9 m' _# b% A/ V# R( i% W$ o# Q; l
maxHeapSize = 268435456 3 L& x1 w8 H! U5 j7 D; V! Q3 v$ ` / E% R$ [/ }: U9 `$ K: j' j%%%END CODE%%% 8 w; S/ w! g; d1 _ ' L( J; R1 r. @7 G$ bThis will give you 256MB of JVM memory and you can adjust the parameter8 y& c! f% [2 j @3 n( J2 U
- ]/ V! @" I+ e3 x+ x7 f
as needed.* X/ t* x& D% j% |* j' n$ H
) N! p3 Q: ^; C) K8 e. G
Note: $MATLAB is the root directory and $ARCH is your system $ n: ]0 v; J7 Y; K' U9 m 2 \# ~& z6 n9 H+ B2 Z% barchitecture. This solution works on Windows as well as Solaris, Linux, 6 ^% n* R C0 _( |- j- F8 A) y' h: g2 S# N- G3 q! R7 J# N
Alpha, and SGI. A similar operation is possible on IBM and HPUX, but with5 m1 u0 `7 m# p; T3 s
- A' ^5 k' O6 P0 T6 {7 S; h
a different syntax. * `& @( t/ P7 o2 s& Q% t0 q . ^7 o4 S% o( f* K9 w- D cFor the 1.1.8 JVM (Windows, Linux, Solaris, Alpha, SGI) our defaults are: 8 e1 U( N7 S' x! Y + f+ y; O6 G- c% N* `! s+ S3 @- \minHeapSize = 16000000 ?" E. v1 z& m2 F# F3 ?; R5 h4 s* u$ N, X: `6 y
maxHeapSize = 640000008 H; m6 X2 O( z; L2 o
8 p4 O8 H$ P1 M7 P" c- |These are the structure field names in that correspond to -ms and 0 ^( [' y+ g# ^7 h 9 Q7 O! }! j" q3 Z7 U3 I* g0 m-mx, and the settings above are roughly 16MB and 64MB.' k6 s' L5 Q. u/ |
! r7 L6 {/ ~, q" C
To investigate the Java heap a bit, ask via the following: 6 _7 c& p; C) t& J. k) K- _5 B. E, s4 L) f
>> java.lang.Runtime.getRuntime.totalMemory 2 t* |; T" ?/ r! D7 p8 W* h" F [6 ]" r+ s$ d& F! N' s5 o
>> java.lang.Runtime.getRuntime.freeMemory ' [* c5 ]& \) b6 ~( v1 {' {( F% D3 d& u% h- d5 ~9 @
When the free memory hits zero, Java will double the heap size (up to the & ?* P& J+ V/ N* V5 X / Z# n/ l+ |# r" Z3 Gmaximum setting).! h M+ g+ M% f1 F. F
& U4 P2 q8 X' @1 q9 p* m9 u
If you choose to run without Java, you will remove the overhead of the 4 b1 q+ r% h$ v+ S, K" [0 L" ]* Y& {8 C7 B a
middle man, but you will also lose some MATLAB functionality (mostly # G7 I/ ?" w1 y, T D j" ]0 J8 n: T3 d" ]
graphics and the Editor). You will still have most of the computational( k+ ^, ~- Z) c: u
- b* y; t d; E" xpower though.( D5 b( i& R! n
f; E/ X5 w" R$ o
Without J***A, memory management will come directly from the OS, and a ; E3 v; `0 l+ i$ v+ v. v# V' W. T: C/ [' E
CLEAR operation will result in memory being freed back to the OS. , T* a% L% M8 ]) d! ^0 q' d0 e: Q/ H8 R s
21)如何在Matlab中添加新的工具箱?' @1 }: M1 t5 v
: F# T* G* D+ H$ n:#FangQ(Qianqian.Fang@Dartmouth.Edu),2002/6/21,BigGreen/MathTools # 1 n+ W! Q# _ [: `5 U1 z # q# @# v) M; {* W如果是Matlab安装光盘上的工具箱,重新执行安装程序,选中即可。$ q# z/ _ r+ X5 t6 W
. d J s# ?/ ~+ v* N: I8 t7 v
如果是单独下载的工具箱,一般情况下仅需要把新的工具箱解压到某 2 Q& K& |2 A) l+ A& P, l* T1 K/ J9 N
个目录,然后用addpath(对于多个目录的使用genpath())或者pathtool添 & \3 M7 z7 _" a/ h, z$ @ ) r( v6 w `+ _ Y加工具箱的路径,然后用which newtoolbox_command.m来检验是否可# n/ f. q9 J% O }; T8 ?* _
! Q3 o' C1 e/ ]以访问。如果能够显示新设置的路径,则表明该工具箱可以使用了。 ! f! v# C/ ^" b* B2 [# e' b$ H" q3 ?
具体请看工具箱自己代的README文件。 & X5 M7 I8 v8 p+ O * D% V8 ]9 o: y: {2 J5 n* |22)如何读写Matlab的.mat文件?1 G" j* j5 d' Y z1 p+ R
& u5 x# p9 ~) o1 V8 J33)Matlab中如何后台运行一个DOS程序?" G# P' r3 V; z# h, j) ~% A8 t4 W
7 z7 N. W. `5 m( u:#FangQ(Qianqian.Fang@Dartmouth.Edu), 2002/6/4. BigGreen/en_Matlab# & K4 h* L# R. S! J ; Y! H& F8 f5 d I3 i) g% d8 H这里是一个后台执行一个需要外部输入的DOS命令的例子,需要的输0 N. D O' j6 j+ U
- S( G$ {# @! K2 R3 B. p
入实事先都写在同目录下的input.txt文件中:: N* B$ E" O! \ c' F