Incorrect values for rank

Incorrect values for rank - getting incorrect values using rank - Messages

#1 Posted: 2/21/2013 10:57:28 AM
Ward Holloway

Ward Holloway

0 likes in 3 posts.

Group: User

I'm using SMATH for a controls class that I am taking. I am getting bad values for rank of a matrix.

A=[0,1;1,0]
should return a rank of 2
I keep getting a 1
#2 Posted: 2/21/2013 11:11:35 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Seems that you defined A as a column vector. Depending on your settings, the comma serves as decimal point or as function argument separator.

type A:mat Enter

This gives you a 2x2 Matrix of placeholders.
rank.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 2/21/2013 11:49:09 AM
Ward Holloway

Ward Holloway

0 likes in 3 posts.

Group: User

The comma's are from my Scilab equation, sorry about the confusion. It looks like my problem is in the way I calculate the matrix. Attached is a quick test I put together.
screen grab.JPG
#4 Posted: 2/21/2013 12:04:27 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

You have made an error defining Γ

You need to use the augment() function; without this function you create a nested matrix.

BTW there is a bug because calling directly the rank function when the first matrix element is a nested matrix, a type conversion error appears.


regards,

w3b5urf3r
rank.sm (11 KiB) downloaded 30 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#5 Posted: 2/21/2013 12:07:37 PM
Ward Holloway

Ward Holloway

0 likes in 3 posts.

Group: User

Excellent, thanks to both of you.
  • New Posts New Posts
  • No New Posts No New Posts