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
 LabTalk Forum
 importing and transforming data in 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

Stéphane

Germany
Posts

Posted - 06/12/2007 :  05:42:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: xp

Hi!

Thanks Mike for your last answer!

a new problem...
I have the following data sets in worksheets: Data1_A, Data2_A. For each value in Data1_A I want to make calculations with all the points in Data2_A, so I should obtain something like a matrix.

Now I tried with MATRIX:set values to assign the following, or also with the CodeBuilder:

double i; double j;

for (i=1; i<=5; i++)
{
for (j=1; j<=5; j++)
{
Cell(i,j) = Data1_A[i]*Data2_A[j];
};
};

quite easy in fact... but it doesn't work!

I also look at the AccessWorksheetObjectsTutorial.c to import the files, but I can't programming and so I have problems!!!

Every help is welcome!
Thank you very much

Stéphane

Deanna

China
Posts

Posted - 06/12/2007 :  05:58:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Stéphane,

Please execute the following code in the Script Window:

for (i=1; i<=5; i++)
{
for (j=1; j<=5; j++)
{
Cell($(i),$(j)) = Data1_A[$(i)]*Data2_A[$(j)];
};
};


Hope this works for you.

Deanna
OriginLab Technical Services
Go to Top of Page

Stéphane

Germany
Posts

Posted - 06/12/2007 :  07:59:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello Deanna!

Thanks for the answer, but I can't make it works :-(
Wenn I give the code in the Script Window (with the matrix as active window), it writes a warning message:

Cell($(i),$(j)) = Data1_A[$(i)]*Data2_A[$(j)] Column name must not be blank

and in the script window:
Cell(i,j) found < 0.5

What make I false?

Thanks!
Stéphane
Go to Top of Page

Stéphane

Germany
Posts

Posted - 06/12/2007 :  08:14:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK, I wrote the script in one line without semicolons, and now it works!

Stéphane
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 06/12/2007 :  08:49:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Stéphane,

Matrix> Set Values works for me...



Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/12/2007 08:53:15 AM

Edited by - Mike Buess on 06/12/2007 08:56:50 AM
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