i need a program to find 5 4 3 2 1 0 -1 -2 -3 -4 -5
MATLAB: How to Write a program that prints out the numbers 5 through -5 in decreasing order.
digital image processingimage processingMATLABsignal processing
Related Solutions
BLAS and LAPACK are the math libraries that MATLAB uses for linear algebra. zgeev is the name of one of the routines in the LAPACK library. E.g., a description can be found on netlib.org (showing Fortran code although the actual libraries that MATLAB uses are likely highly optimized C/assembly using the same interface):
If you look at the comments for this routine, you see this for "info":
* INFO (output) INTEGER* = 0: successful exit* < 0: if INFO = -i, the i-th argument had an illegal value.* > 0: if INFO = i, the QR algorithm failed to compute all the* eigenvalues, and no eigenvectors have been computed;* elements and i+1:N of W contain eigenvalues which have* converged.
So it appears that the 5th argument had an illegal value. If you look at the signature and the code for generating the error you see this:
SUBROUTINE ZGEEV( JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, $ WORK, LWORK, RWORK, INFO ) : * ZGEEV computes for an N-by-N complex nonsymmetric matrix A, the * eigenvalues and, optionally, the left and/or right eigenvectors. : ELSE IF( LDA.LT.MAX( 1, N ) ) THEN INFO = -5
So the 5th input argument, LDA, was less than MAX(1,N), generating the error. Based on nothing more than what you have posted, this looks like a bug in the calling routine. So technical support needs to look at the underlying code that is generating this call.
Is there something unusual about the inputs you are using for your apparent eigenvalue calculations? E.g., if LDA = 0 then this would generate this error. And if you look at what LDA is in the code:
COMPLEX*16 A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ), $ W( * ), WORK( * )
You see that it is the first dimension of one of the input arrays. Are you passing in (i.e. trying to compute the eigenvalues of) a matrix with this first dimension equal to 0?
Hi,
To reformulate your question (as I understood it) you would like to be able to return the count of occurrences of each element in a vector. There are multiple ways to do this. One solution would be by using hist and unique functions
x=[2 5 2 52 5 25 2 5 2 22 5 2 5 52 5 55 4 5 5 2 5 5 25 2 5 2 54 5 54 5 2 5 5 5 5 5 5 5 25 2 255 2 5 5 2 55 2 5 5 2 5 5 2 255 2 52 5 2 5 ];>> [a,b]=hist(x,unique(x))a = 17 1 28 1 3 3 2 2 2b = 2 4 5 22 25 52 54 55 255
where a(i) is the (count) of b(i).
Best Answer