Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
eigs display error

Subject: eigs display error

From: Nick

Date: 27 Mar, 2013 19:20:06

Message: 1 of 2

It looks like there is a typo in the eigs function (I'm using R2012a on windows7)
From line 1349:
innerstr = getString(message('MATLAB:eigs:PrintTimingsComputeAX',sprinf('%f',cputms(3))));

It says "sprinf" rather than "sprintf".
An error occurs when running the following code, specifically with display level 2

A=rand(900); A=A'*A;
opts.disp=2; opts.v0 = ones(size(A,1),1);
[V,D]=eigs(A,[],1,'lm',opts);

This is the output:

Iteration 1: a few Ritz values of the 20-by-20 matrix:
     0
Undefined function 'sprinf' for input arguments of type 'char'.
Error in eigs/printTimings (line 1349)
            innerstr =
            getString(message('MATLAB:eigs:PrintTimingsComputeAX',sprinf('%f',cputms(3))));
Error in eigs (line 415)
    printTimings;

Has anyone else experienced this issue and know how to fix it? I tried modifying the eigs.m source file but it wouldn't allow me (said access denied).

Subject: eigs display error

From: Steven_Lord

Date: 27 Mar, 2013 21:24:10

Message: 2 of 2



"Nick " <dsfadfa@aol.com> wrote in message
news:kivgp6$uh$1@newscl01ah.mathworks.com...
> It looks like there is a typo in the eigs function (I'm using R2012a on
> windows7)
> From line 1349: innerstr =
> getString(message('MATLAB:eigs:PrintTimingsComputeAX',sprinf('%f',cputms(3))));
>
> It says "sprinf" rather than "sprintf".
> An error occurs when running the following code, specifically with display
> level 2
>
> A=rand(900); A=A'*A;
> opts.disp=2; opts.v0 = ones(size(A,1),1);
> [V,D]=eigs(A,[],1,'lm',opts);
>
> This is the output:
>
> Iteration 1: a few Ritz values of the 20-by-20 matrix:
> 0
> Undefined function 'sprinf' for input arguments of type 'char'.
> Error in eigs/printTimings (line 1349)
> innerstr =
>
> getString(message('MATLAB:eigs:PrintTimingsComputeAX',sprinf('%f',cputms(3))));
> Error in eigs (line 415)
> printTimings;
>
> Has anyone else experienced this issue and know how to fix it?

Yes, this is a typo in the EIGS function. It has been fixed in release
R2013a.

> I tried modifying the eigs.m source file but it wouldn't allow me (said
> access denied).

That suggests to me that you're using a central installation maintained by
your IT staff. If that is the case, ask your IT staff to add the missing 't'
to that line of eigs.m or to give you file access permission to modify that
file so you can fix it, then execute this command in MATLAB so the toolbox
cache is updated to reflect the fix:

rehash toolboxcache

Other solutions include turning down the display level to level 1 (if you
don't need the timing information) or (involving _slightly_ more work :)
upgrading to release R2013a.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us