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
 Minimum
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Chris2

20 Posts

Posted - 10/04/2010 :  06:49:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Windows Vista
Origin 8.1.

Hello,

another question, how is it possible to get the minimum of one specefic row, but noch from the whole row but just for example from column 3 to 9.

Chris2

20 Posts

Posted - 10/04/2010 :  10:08:04 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
For some reason I can't edit my topic. So I do it this way:

noch = not
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 10/04/2010 :  11:23:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try This ....

double GetWksRowInfo(uint nRow, uint iBgn, uint iEnd)
{
	Worksheet WksSource=Project.ActiveLayer();
    if(WksSource.IsValid()==true && nRow<WksSource.GetNumRows() && iBgn<iEnd && iEnd<WksSource.GetNumCols())
    {
    	/*
    		nRow ...   Row number to be analyzed (0 Offset)
    		iBgn ...   Starting Column Number  (0 Offset)
    		iEnd ...   Ending Column Number    (0 Offset)
    	*/
	   matrix mat;
	   if(mat.CopyFromWks(WksSource,0,-1,nRow,nRow )==true)
	   {
			vector<double> vecRow;
			if(mat.GetAsVector(vecRow)>0)
			{
				vector<double> vctSub;
				if(vecRow.GetSubVector(vctSub,iBgn,iEnd)==0)
				{
				
					return (min(vctSub));
				}
			}
		}
   }
   return (NANUM);
}

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