MATLAB稀疏矩阵的作图问题>> a=[1 2 4;1 2 5;3 4 5]a =1 2 41 2 53 4 5>> speye(size(a))ans =(1,1) 1(2,2) 1(3,3) 1>> spy(a,'+',20)Error using ==> errorWhen the first input is a message identifier,the second inputmust be a string.Error in ==> spy

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/06 17:43:02
MATLAB稀疏矩阵的作图问题>> a=[1 2 4;1 2 5;3 4 5]a =1 2 41 2 53 4 5>> speye(size(a))ans =(1,1) 1(2,2) 1(3,3) 1>> spy(a,'+',20)Error using ==> errorWhen the first input is a message identifier,the second inputmust be a string.Error in ==> spy
xT]OA+F7 E| &>&>VXviv >Ubᛊ`vnggZQfwv{9F÷o _Yoz^>[;i/qFI\ C{b H+Mk!KpX5, +a(1 !!UУD.I,HX,N΄f̄FuHOn4R4#뚩8K4$05{VD^YB7D~3~^~e8)OWb%`{#cĪ\KZuibΉOdsό$jD.#Q<#]+׍jRyzG>~k/۾Qrow7Bw/0w޷w`{K V#7Ձ_7g?2l6Hg[YVv7H 䤩T>".Y$6j,67$AOvwcdz 0׫2˻b-UEoY+@ʗwT{~ŷm^9=e33 u\ﭫ@(h.uU º^p:3ZG 0)*"/br\q],߄vNW;ɂ\Ǡ}\+&xE|1O?+}+V^v^.zS-2A F߭d q8~$IjF"3| S9(EBsM;Bb| Q`۫ԝ\@ o!VsF#سc8 'w;4/DQ/gETx*)bҪRS

MATLAB稀疏矩阵的作图问题>> a=[1 2 4;1 2 5;3 4 5]a =1 2 41 2 53 4 5>> speye(size(a))ans =(1,1) 1(2,2) 1(3,3) 1>> spy(a,'+',20)Error using ==> errorWhen the first input is a message identifier,the second inputmust be a string.Error in ==> spy
MATLAB稀疏矩阵的作图问题
>> a=[1 2 4;1 2 5;3 4 5]
a =
1 2 4
1 2 5
3 4 5
>> speye(size(a))
ans =
(1,1) 1
(2,2) 1
(3,3) 1
>> spy(a,'+',20)
Error using ==> error
When the first input is a message identifier,the second input
must be a string.
Error in ==> spy at 26
error('MATLAB:spy:InvalidLinespecString',msg)

MATLAB稀疏矩阵的作图问题>> a=[1 2 4;1 2 5;3 4 5]a =1 2 41 2 53 4 5>> speye(size(a))ans =(1,1) 1(2,2) 1(3,3) 1>> spy(a,'+',20)Error using ==> errorWhen the first input is a message identifier,the second inputmust be a string.Error in ==> spy
这是说error的第2个参数应该是字符串
在spy.m的第26行
error('MATLAB:spy:InvalidLinespecString', msg)
而msg定义在程序之前两行
[line,color,marker,msg] = colstyle(arg2);
arg2是你的第二个参数'+',colstyle的作用是分析字符串得出线形,颜色和标志符号,msg给出错误信息.正常情况下msg为空,而根本不会调用26行.'+'应该是合法符号,在我机子上运行是正常的
所以说问题出在colstyle函数里,你应该查一下你的目录下有没名为colstyle的文件,或是colstyle有没被改动过
试试调用[line,color,marker,msg] = colstyle('+')正常的话msg应该为[]
colstyle里用到的函数find min any all length meshgrid有没重名或是被改动过的 只能想到这么多了 反正只要有耐心回溯上去一定能找到问题的
实在不行的话 把26行注释掉,改成marker = arg2;就可以了