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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 simple math with wks

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
prgo Posted - 11/29/2006 : 09:36:58 AM
Origin Version (Select Help-->About Origin):
Operating System:winXP
i-m new here, and my problem is probably very stupid but...
the idea is: i have two wks, and create the third one.
the second column of the third wks is obtained just by multiplaying
two different columns.
here is my code:

void test ()

{

Worksheet wks1("correction");
Worksheet wks2("data");
Worksheet wks3;
wks3.Create();
wks3.GetPage().Rename("Results");

Dataset dsColA(wks1,0);
Dataset dsColB(wks1,1);
Dataset dsColF(wks2,5);
Dataset dsColAA(wks3,0);
Dataset dsColBB(wks3,1);

dsColAA = dsColA;
dsColBB = dsColF * dsColB;

}

the problem is, the "results" dataset with two columns is created, but with values only for the first column (dsColAA).
the values in dsColBB are not there (and they should be ranging from 1E-3 to 1E7)....

any suggestion would be great!!!!

prgo
6   L A T E S T    R E P L I E S    (Newest First)
prgo Posted - 12/01/2006 : 05:21:40 AM
thanks a lot!!!!
zachary_origin Posted - 11/30/2006 : 9:31:02 PM
Hi prgo,

I looked into your opj file. The problem is: in worksheet "correction", there are rows with missing values after row 2048, then the size of dsColF is more than 2048. While in worksheet "data", there are exactly 2048 rows. So dsColF and dsColB have different size. After mannually deleting the rows with missing values, it works fine.
I will discuss with our developers to see if it is necessary to improve this to support multiply two vectors with different sizes. Thanks for reporting this.



Zachary
OriginLab Technical Services.
prgo Posted - 11/30/2006 : 11:07:20 AM
thanks! i have sent it.

function looks like this:

void test ()

{

Worksheet wks1("correction");
Worksheet wks2("data");
Worksheet wks3;
wks3.Create();
wks3.GetPage().Rename("Results");

Dataset dsColA(wks1,0);
Dataset dsColB(wks1,1);
Dataset dsColF(wks2,5);
Dataset dsColAA(wks3,0);
Dataset dsColBB(wks3,1);

dsColBB.SetSize(dsColF.GetSize());

dsColAA = dsColA;
dsColBB = dsColF * dsColB;

GraphPage gr;
string strTemplate = "template.otp";
BOOL bOK = gr.Create(strTemplate, CREATE_VISIBLE);

if (!bOK)
return;

GraphLayer grlay = gr.Layers(0);
ASSERT(grlay.IsValid());
Curve cv("Results_b");
ASSERT(cv.IsValid());
bOK = 0 <= grlay.AddPlot(cv);
if (!bOK)
return;
grlay.Rescale();

}


and it works ok when i test it, but not with "my numbers" (which are in *.OPJ file)

zachary_origin Posted - 11/30/2006 : 10:02:46 AM
Hi prgo,

Tested and worked fine for me, too.
If possible, would you mind sending the .opj file to us thru tech@originlab.com ?

Zachary
OriginLab Technical Services.
prgo Posted - 11/30/2006 : 07:30:11 AM
i-m a "little" bit lost,
i tried with "fill column with", (all the columns in both wks)
and then everything is ok.
but when i try to do it with "my numbers" (experimental data)
i have the same problem...it does not multiplay for the second column of the wks3.

each column contains cca 3000 rows, could that be a problem, or it is about the values?

Mike Buess Posted - 11/29/2006 : 11:18:42 AM
Hi prgo,

Your function worked fine in my tests. The only reason I can think of why it might fail is if the "data" wks had less than 6 columns or the 6th column contained missing values.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000