Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Error 1050 Occurred in MATLAB® Script Node: Complex Values Cannot be Converted to Chars

Primary Software: LabVIEW Development Systems>>LabVIEW Professional Development System
Primary Software Version: 7.1.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Toolkits>>Math Interface Toolkit

Problem:
I'm trying to provide a MATLAB® Script Node with a path or string.  I get run-time "Error 1050 occurred at LabVIEW: Error occurred while executing script.  Error message from server:???  Error using ==> char.  Complex values cannot be converted to chars.  Possible reason(s): LabVIEW: Error occurred while executing script."

I can run the Fractal example just fine, but I get the same error when I try to Lorenz Diff Eq.



Solution:
The MATLAB®  Script Node has improperly converted the array from real data to complex data.  You can use additional commands in the MATLAB®  Script Node to properly format the data into a character array.  Consider the following example.

The input a is configured as a Real Vector.

However, if you open the MATLAB®  Workspace Browser from the Command Window in the MathWorks Inc. MATLAB® software...

You will see that the actual data type of the variable is complex.

To fix this, you can add two additional commands (real and uint8) to the MATLAB® Script Node that convert the data to the real type compatible with the char function.


The correct data type for the char function is reflected in the Workspace Browser in the MATLAB software.

MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.



Related Links:
KnowledgeBase 2C1AH6DM: LabVIEW 6.x and Earlier Does Not Interface Properly with The MathWorks, Inc. MATLAB® Software Version 6.1 or 6.5
KnowledgeBase 2VNDL65Z: Why Do I Get Error 1047 When Trying to Use The MATLAB® Script Node in LabVIEW?
KnowledgeBase 300A6NDT: How Can I Resolve MATLAB® script node and Xmath Script Node Issues in LabVIEW?


Attachments:





Report Date: 07/30/2008
Last Updated: 08/04/2008
Document ID: 4NTB3MYP

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit