9.11.09

Delet masked points

http://www.originlab.com/forum/topic.asp?TOPIC_ID=7831&SearchTerms=IsMask
http://www.originlab.com/forum/topic.asp?TOPIC_ID=3453


1.
!comments: [-><
Select Worksheet : Extract Worksheet Data...

To Delete:
Select the column with Masked values (presumably your Y column)
Click the => button to create an Alias (in this example : B)
In the Condition text box, type
B[i]!=0
Click Test -- select if true button
(This causes only those rows with masked values to be selected.)
Click the Close button
Select Edit : Delete from the menu (NOT the Delete key)
All rows with masked values are removed.

To Copy:
Select the column with Masked values (presumably your Y column)
Click the => button to create an Alias (in this example : B)
In the Condition text box, type
B[i]==0
Select 'Extract to New Workbook' as Output
Click OK
New Workbook will contain only those rows without masked values.

2.
// Get number of rows in current sheet
irows = wks.maxrows;
// Save name of current sheet in %a variable
%a=%h;
// Create a new sheet
win -t;
%z = %h;
// Initialize counter
inum = 1;
// Loop over all rows of source sheet
for(ii=1; ii<=irows; ii++) { // If cell in 1st col is masked... if( 1 != ismasked(ii, %(%a,1)) )
{
for (jj=1; jj<=wks.nCols; jj++) { // Copy over to destiation %(%h,jj,inum) = %(%a,jj,ii); } // Update counter inum++; } } wks.export.cntrl = 2; save -wh %h %1; win -c %h;
Go to Top of Page

5.11.09

Worksheets(ActiveCell.Worksheet.Name).Select

Sub solveV0()

Dim NRow As Long, i As Long
Dim beta1 As Double, beta2 As Double, beta As Double
Dim V As Double, H As Double, h0 As Double, V0 As Double
Dim f As Double, dfdV0 As Double

Worksheets(ActiveCell.Worksheet.Name).Select

NRow = Cells(2, 10)
beta1 = Cells(2, 3)
beta2 = Cells(2, 4)

beta = (beta1 + beta2) ^ (beta1 + beta2) / beta1 ^ beta1 / beta2 ^ beta2

For i = 1 To NRow
V = Cells(4 + i, 1)
V = Abs(V)
H = Cells(4 + i, 2)
H = Abs(H)
h0 = Cells(4 + i, 8)
V0 = Sqr(V ^ 2 + H ^ 2)
If (H = 0) Then
V0 = V
Else
f = H / (V0 * h0) - beta * (V / V0) ^ beta1 * (1 - V / V0) ^ beta2
Do While (Abs(f) >= 0.000001)
dfdV0 = -H / h0 / V0 ^ 2 + beta * beta1 * V ^ beta1 / V0 ^ (beta1 + 1) * (1 - V / V0) ^ beta2 - beta * beta2 * (V / V0) ^ beta1 * (1 - V / V0) ^ (beta2 - 1) * V / V0 ^ 2
V0 = V0 - f / dfdV0
f = H / (V0 * h0) - beta * (V / V0) ^ beta1 * (1 - V / V0) ^ beta2
Loop

End If
Cells(4 + i, 9) = V0
Next i

End Sub