# 2.2.3.28 w2vm

## Brief Information

Create a virtual matrix from worksheet data

Minimum Origin Version Required: 8.5.1

The vmname, coltype, rowtype variables are introduced from Origin 2015.

## Command Line Usage

 1. w2vm irng:=[Book1]Sheet1 rowpos:=selrow1 colpos:=selcol1 ztitle:=VMObject; 

2. w2vm irng:=1!2[1]:4[3] rowpos:=3 label:=L colpos:=2 ztitle:=MyVM; 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input irng

Input

Range

<active>
Specify Z values of the virtual matrix.
Data Layout format

Input

int

0
Specify which way to set the X and Y values.

Option list:

• yacross:Y across columns{0}
Use a row as Y-values and a column as X-values.
• xacross:X across columns{1}
Use a row as X-values and a column as Y-values.
Y/X Values in rowpos

Input

int

<auto>
Specify the row for Y(or X)-values. Whether Y or X-values are specified is determined by the value of format.

Note that Y(or X)-values in the row should be in descending or ascending order.

Option list:

• none:None{0}
Use column number in the selected range of cells from a worksheet as Y(or X)-values, which starts from 1.
• selrow1:1st row in selection{1}
Use column number in the selected range of cells from a worksheet as Y(or X)-values, which starts from 1.
• label:Column label{2}
Use the column labels in the worksheet as the Y(or X)-values. Column Label row is specified in label. Note that if only a range of a worksheet is specified in irng, only the corresponding part of the Column Label row in the worksheet is used as Y(or X)-values.
• custom:Custom{3}
Specify a row in the worksheet.
Y/X Range rowrng

Input

Range

<unassigned>
Specify a row for Y(or X)-values. rowrng should be specified only when rowpos is set to Custom.

Note that rowrng should be in the same worksheet of irng.

Column Label label

Input

string

<unassigned>
Specify a string for Column Label whose row is used as Y(or X)-values. label should be specified only when rowpos is set to Column label. It needs to use a single character to specify the column label row in script. Please refer to Column Label Row Characters for the single character of each column label row.
Format Y/X Data rowtype

Input

string

<unassigned>

Specify the data format of the X/Y data. This variable is only accessible when the rowpos variable is not set to 0 (None). You can refer to supported Origin Formats notation for details.

X/Y Values in colpos

Input

int

<auto>
Specify the column for X(or Y)-values. Whether X or Y-values are specified is determined by the value of format.

Note that X(or Y)-values in the column should be in descending or ascending order.

Option list:

• none:None{0}
Use row number in the selected range of cells from a worksheet as X(or Y)-values, which starts from 1.
• selcol1:1st column in selection{1}
Use the first column in the selection as X(or Y) values.
• wkscol1:1st column in worksheet{2}
Use the first column in the worksheet as X(or Y) values.
• xcol:X column to left of selection{3}
Use the nearest X column to the left of the range of irng as X(or Y)-values. It can be specified only when there is at least one X column on the left side of the range of irng.
• custom:Custom{4}
Specify a column in the worksheet.
X/Y Range colrng

Input

Range

<unassigned>
Specify a column for X(or Y)-values. colrng should be specified only when colpos is set to Custom.

Note that colrng should be in the same worksheet of irng.

Format X/Y Data coltype

Input

string

<unassigned>

Specify the data format of the X/Y data. This variable is only accessible when colpos variable is not set to 0 (None). You can refer to supported Origin Formats notation for details.

X Title xtitle

Input

string

X Title
Specify the X-axis title.
Y Title ytitle

Input

string

Y Title
Specify the Y-axis title.
Z Title ztitle

Input

string

Z Title
Specify the Z-axis title (or called long name of the virtual matrix).
Virtual Matrix Name vmname

Input

string

<unassigned>
Specify the name of virtual matrix.

## Description

This X-Function can be used to create a virtual matrix object from worksheet data. After the virtual matrix object has been created, it can be accessed in Plot Details dialog and Layer Contents dialog etc. to create a new graph.