Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear experts, i need the source code of this function: inv(Matrix mat) that returns the inverted mat. It's sort of emmergency, i don't have much time. could anybody show me the code?
Thank you in advance.
Posted

1. If you want Matlab source code then ask at the Matlab site, we do not provide code to order.
2. No one here is impressed by you saying "it's an emergency", we have our own priorities.
3. If you don't have much time then you should learn to plan better.
 
Share this answer
 
Comments
Andreas Gieriet 12-Oct-13 8:59am    
My 5!
Item 3) is "cruel" - I like it :-) (sorry for being so blunt...)
Cheers
Andi
Richard MacCutchan 12-Oct-13 9:14am    
Don't apologise, I was also being blunt. People really need to learn that this sort of question cuts no ice.
Member 8945248 12-Oct-13 9:10am    
My apologies, Thank you for your guidence.
In addition to Richard MacCutchan's advise, have a look on Google.
For explaining Matrix inversion, see http://en.wikipedia.org/wiki/Invertible_matrix#Methods_of_matrix_inversion[^].
For some implementations see http://math.fullerton.edu/mathews/n2003/InverseMatrixMod.html[^] or many other sources...
Cheers
Andi
 
Share this answer
 
Comments
Member 8945248 12-Oct-13 9:11am    
Thank you dear Andreas.
Andreas Gieriet 12-Oct-13 9:17am    
You are welcome.
I hope it is of any help.
I understand you expected more, but, hey, Mathlab is not open source, how could you dream of getting their sources? Or did you expect some cracked code here?
Cheers
Andi
Member 8945248 12-Oct-13 9:33am    
I accept that i made a mistake. It was a hasty situation and i lost that anyway. Since i didn't have time to create an account in mathwork i posted that here which was a mistake. I assumed that somebody may have the code.
Andreas Gieriet 12-Oct-13 11:02am    
Respect! Not everyone would openly tell having made a mistake!
Honestly, I'm looking forward to see you again on CP under less pushy circumstances!
Have a good day!
Cheers
Andi
Member 8945248 12-Oct-13 11:10am    
Thank you Andi. Sure you will see me, but with more related questions. ;-)
best,
Whenever I need to convert some algorithms from Matlab to C/C++, I always go through the operations and implement them independently of the rest of the algorithm. This makes the problem a lot easier to handle by breaking it down.

If you look at what inv() does, it's really quite simple, but you have to make some implementation decisions because vectors are treated a bit differently in matlab than they are in the C/C++ world. So you have to bind the problem by deciding how your matrix will be passed to/from the function (what it will "look" like), then simply loop and do your swapping operation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900