Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Ward.Holloway  
#1 Posted : 21 February 2013 17:57:28(UTC)
Ward.Holloway

Rank: Newbie

Groups: Registered
Joined: 21/02/2013(UTC)
Posts: 3
United States
Location: Barre, MA

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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 21 February 2013 18:11:35(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
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.
mkraska attached the following image(s):
rank.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Ward.Holloway  
#3 Posted : 21 February 2013 18:49:09(UTC)
Ward.Holloway

Rank: Newbie

Groups: Registered
Joined: 21/02/2013(UTC)
Posts: 3
United States
Location: Barre, MA

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.
Ward.Holloway attached the following image(s):
screen grab.JPG
Offline Davide Carpi  
#4 Posted : 21 February 2013 19:04:27(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
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

Edited by user 21 February 2013 19:12:44(UTC)  | Reason: Not specified

File Attachment(s):
rank.sm (12kb) downloaded 13 time(s).
Davide Carpi attached the following image(s):
SMath Studio - [rank.sm]_2.png
SMath Studio - [rank.sm].png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Ward.Holloway  
#5 Posted : 21 February 2013 19:07:37(UTC)
Ward.Holloway

Rank: Newbie

Groups: Registered
Joined: 21/02/2013(UTC)
Posts: 3
United States
Location: Barre, MA

Excellent, thanks to both of you.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.