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
 vertical profile of 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

bedibra

France
35 Posts

Posted - 08/31/2017 :  08:19:16 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,
I am looking for a script that gives me the possibility to get the vertical profile of the a matrix (as in the picture), where I have to specify the X value and the size of the line.
I found the mat.profile. property, but I don't know how to use it.
if possible I want the profile in the [book1]sheet1!col(a).
thanks,

Hideo Fujii

USA
1582 Posts

Posted - 08/31/2017 :  4:19:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi bedibra,

You can save your vertical profile plot as a template, then you can make the plot by plotm x-function.
Try the following snippet:

img2m -r 2;  //Convert the image to data matrix
mname$=%H;   //matrix name
plotm im:=[mname$]!1 plot:=220 ogl:=[<new template:=myVProfile>];  //Plot the matrix using the template
imageprofile;  //Activate as a image profile
pname$=%H;     //graph name
speedmode sm:=off; //turn off speed mode
page.active = 1;  //activate the main layer
VLine.x=100;   //position of 1st line
VLine1.x=150;  //position of 2nd line
window -a Book1;  //activate the worksheet
worksheet -s 1 1 1 1;  //select a cell
insertGraph gname:=%(pname$) embed:=1;  //embed the graph to the cell
Works?

--Hideo Fujii
OriginLab
Go to Top of Page

bedibra

France
35 Posts

Posted - 08/31/2017 :  5:56:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks for your reply. However this is not really what I want.
is there a way to use this :
mat.profile(?????) ;
mat.profile.vSection=10;
mat.profile.vWksName$=[book1]sheet1!;
mat.profile.vYCol=1;
however I am getting some difficulties to make it work, and I am getting this error message: Must specify 3 values as arguments.

I am pretty sure that this is what I am looking for but I really need help to make it work.
thanks



quote:
Originally posted by Hideo Fujii

Hi bedibra,

You can save your vertical profile plot as a template, then you can make the plot by plotm x-function.
Try the following snippet:

img2m -r 2;  //Convert the image to data matrix
mname$=%H;   //matrix name
plotm im:=[mname$]!1 plot:=220 ogl:=[<new template:=myVProfile>];  //Plot the matrix using the template
imageprofile;  //Activate as a image profile
pname$=%H;     //graph name
speedmode sm:=off; //turn off speed mode
page.active = 1;  //activate the main layer
VLine.x=100;   //position of 1st line
VLine1.x=150;  //position of 2nd line
window -a Book1;  //activate the worksheet
worksheet -s 1 1 1 1;  //select a cell
insertGraph gname:=%(pname$) embed:=1;  //embed the graph to the cell
Works?

--Hideo Fujii
OriginLab


Go to Top of Page

bedibra

France
35 Posts

Posted - 09/01/2017 :  09:36:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
any ideas ?
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 09/01/2017 :  10:04:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Which version of Origin are you using?
We can put together some Origin C code and provide it as an X-Function to be used from LabTalk.

CP
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 09/01/2017 :  10:16:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi bedibra,

It appears that mat.profile object method works to create the profile worksheet data as described in
http://www.originlab.com/doc/LabTalk/ref/mat-obj .
For example, try the following snippet:
win -t mat;  //make a new matrix
matrix -ps DIM 300 300;  //set the dimensions
mat.matname$ = %H;       //set the matrix name
msetvalue im:=[%(mat.matname$)]1!1 formula:="sin(x)+sin(y)";  //Fill data in matrix
win -t wks xyz;      //create the profile worksheet
mat.wksname$ = %H;   //worksheet name
mat.profile.angle=0; //angle for Z profile
mat.profile(3,3);    //produce profile data
wks.colSel(3,1);     //select the Z column
worksheet -P 240 glTraject;  //plot as a 3D line
Hope this helps.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 09/01/2017 10:32:59 AM
Go to Top of Page

bedibra

France
35 Posts

Posted - 09/01/2017 :  11:09:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I am using the 2016 version. it will be very helpfull, if we can get automatically on a sheet the values of a vertical profile of a matrix .

quote:
Originally posted by cpyang

Which version of Origin are you using?
We can put together some Origin C code and provide it as an X-Function to be used from LabTalk.

CP



Edited by - bedibra on 09/01/2017 11:28:44 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