The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 [solved] adding row and columns to a matrix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Simon.N

France
Posts

Posted - 07/17/2007 :  07:10:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7 SR2
Operating System: Vista

Hi,

I am using matrix and vectors to store some data from a datasheet, for later analysis.
Since I cannot know how many rows I will need, I tried to add rows dynamically, but I didn't find any function in the Origin help.

My matrix are global variables. I wrote a function which redifined the matrix, with greater number of rows. (with eventually a temporary matrix to store the data of the main matrix to copy it in the first row of the new extended matrix.)

But since i do those operations in a function, it seems that the range of the extended matrix is limited to this function. So, finally, my matrix is still too small.

Then I thought that I could give my function the adress of the matrix, in order to avoid the problem of the range, but i didn't find how to free the memory occupied by the smaller instantation of my matrix.

Am I on the right way ? Otherwise, how could I bypass this problem please ?

Thanks,

Simon Nicolas.


Edited by - Simon.N on 07/17/2007 08:29:02 AM

Mike Buess

USA
3037 Posts

Posted - 07/17/2007 :  07:27:26 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Simon,

Use matrixbase::SetSize to add or subtract rows or columns. (You might need to update to SR4.)

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/17/2007 07:39:14 AM
Go to Top of Page

Simon.N

France
Posts

Posted - 07/17/2007 :  08:07:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike,

It works fine even without upgrading to SR4.


Simon.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000