LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Error code from Matlabscript

Hi,
I'm using Matlab script node to interpolate a 2D Surface. But sometimes it shows an error and close the program.
The error message is not always there. It appeared when I gave it some specified "XLength" or "YLength".
Here is the error message:
 
Error 1050 occurred at LabVIEW:  Error occurred while executing script.
Error message from server: ??? qhull precision error: initial facet 2 is coplanar with the interior point
ERRONEOUS FACET:

While executing:  | qhull d Qt Qbb Qc
Options selected for Qhull 2003.1 2003/12/30:
  delaunay  Qtriangulate  Qbbound-last  Qcoplanar-keep  _pre-merge
  _zero-centrum  Pgood  Qinterior-keep  _max-width 1e+003
  Error-roundoff 1.4e-012  _one-merge 9.7e-012  Visible-distance 2.8e-012
  U-coplanar-distance 2.8e-012  Width-outside 5.5e-012  _wide-facet 1.7e-011

The input to qhull appears to be less than 3 dimensional, or a
computation has overflowed.
Qhull could not construct a clearly convex simplex from points:

The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet.  The maximum round off error for
computing distances is 1.4e-012.  The center point, facets and distances
to the center point are as follows:
 

facet
 p4
 p20
 p0
 distance= -1.1e-013
facet
 p24
 p20
 p0
 distance=    0
facet
 p24
 p4
 p0
 distance=    0
facet
 p24
 p4
 p20
 distance=    0
 
I hope, I can get some advises here. Thanks in advance!
 
 
0 Kudos
Message 1 of 17
(10,123 Views)
Hi,
 
The Matlab Script Node calls the MATLAB software to execute scripts. The error is also returned by MATLAB software. Possibly, it is caused by internal numerical error. Note that the Qhull algorithm is numerical sensitive.
 
Have you ever tried this code in MathScript Node? The LabVIEW MathScript syntax is similar to the MATLAB language syntax. However, LabVIEW MathScript does not depend on MATLAB software.
 
0 Kudos
Message 2 of 17
(10,117 Views)

Hello ttrr,

Mathscript is also a good solution. But LabVIEW requires a patch  for using 'griddata'. However, even if I've installed the patch, the Mathscript didn't work.

Anyway, I don't think Mathscript will solve the problem without changing the Blockdiagram. Since the algorithm is more or less the same for 'griddata'.

0 Kudos
Message 3 of 17
(10,112 Views)

Hi,

Would you please let me know what's the problem in MathScript function griddata? Why do you think MathScript can not solve your problem withouth changing the BD?

I would appreciate if you coulde share some ideas with us.

0 Kudos
Message 4 of 17
(10,096 Views)
Hi,
 
I've tried the Mathscript, as I've mentioned, but it didn't work so well as the Matlabscript. LabVIEW will crash, if some specified data are input.
 
Here's how my programm works:  I've chosen 'cubic' as the interpolation method on a 50X50 square. In the square I have several points, on which the Z value is known. As the 'cubic' cannot accomplish extrapolation, two SubVIs for linear extrapolation are added in the Diagram. If the subVIs are disabled, the program runs without crash. However, no extrapolation will be done.
 
So the question is, what kind of extrapolaion should not  be done?
0 Kudos
Message 5 of 17
(10,089 Views)
Hi,
 
If possible, can you share your code with us? We would like to look into the detail about this problem, especially the crash.
 
Or, can you let me know your email? We can talk about this problem offline.
 
Thanks!
 
0 Kudos
Message 6 of 17
(10,086 Views)

Hi,

well, then I'll post the subVI for the extrapolation here. You can read the example data on the front panel, for example X,Y,Z.



Message Edited by wilburwu on 03-18-2008 05:14 AM
0 Kudos
Message 7 of 17
(10,081 Views)
To clarify the problem, I've written this program.
0 Kudos
Message 8 of 17
(10,069 Views)
0 Kudos
Message 9 of 17
(10,057 Views)

Hi,

I think you are using LabVIEW 8.5. There are some bugs in LabVIEW 8.5 which cause the 'linear' and 'cubic' options of griddata to return incorrect result. Fortunately, we have already found these bugs and fixed them. If you got a chance to try the LabVIEW 8.6 Platform Beta, you could verify the fix. Here, I attach some snapshots of the result for the 'cubic' option of griddata with the fix. I specify the XLength and YLength to 1000. Are these the results you want?

As to the crash problem, I am unable to reproduce it on my machine. I follow the instruction to set XLength to 1000 and YLength to 880. All combination of method and option of griddata work well. Therefore, I do not have any idea about it. Maybe, you can try to reinstall the LabVIEW software.

I do not have access to MATLAB software. Hence, I am unable to run your code with MATLAB Script Node.

Many thanks!!!



帖子被ttrr在03-18-2008 08:39 PM时编辑过了
Download All
0 Kudos
Message 10 of 17
(10,041 Views)