Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by unity_421562675 · Aug 09, 2018 at 09:43 AM · script error

Error CS0246: The type or namespace name `MLApp' could not be found. Are you missing an assembly reference?

I was trying to call Matlab function in C# scripts.

Here is the version of softwares I am using: Matlab: 8.6.0.267246 (R2015b) // Unity 2018.2.2.f1 // Visual Studio 15.7.6

To test the feasibility I set up a simple test code (shown below) added reference "MatlabApplication (Version 8.6) Type Library" and attached it to an empty object. However, I constantly met this compiler error when running this script in Unity.

I would really appreciate it if someone could give me some advice. I am familiar with Matlab but basically a novice in Unity and C# (just self-taught a week ago). Thank you in advance.

namespace MatlabExecution{ public class DanceWithMatlab : MonoBehaviour { public MLApp.MLApp matlab = new MLApp.MLApp();

     public DanceWithMatlab()
     {
         // Step 1:
         // Create the MATLAB instance 

         // Change to the directory where the function is located 
         matlab.Execute(@"cd C:xx"); // path name is omitted for privacy reason

         // Define the output 
         object result = null;

         // Call the MATLAB function 
         matlab.Feval("Test", 1, out result, 1, 2); // Matlab function name

         // Display result 
         object[] res = result as object[];
         Console.WriteLine(res[0]);
         //Debug.Log("The result is {0}", res[0]);

         matlab.Execute("quit");
     }
 }

}

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image unity_3Y-L6RUUZwPSjQ · Sep 06, 2018 at 02:55 PM 0
Share

Hi there,

I'm trying to do the same (just trying to call a simple matlab function from unity) but getting the same error, do you find a solution in the end?

avatar image jskumaar · Dec 03, 2019 at 05:02 PM 0
Share

Hi @unity_421562675 , @unity_3Y-L6RUUZwPSjQ

I am facing the same issue. Did you find a solution to this?,Hi,

I am facing the same issue. Is there another way to call $$anonymous$$ATLAB functions from unity? I tried compiling a dll, but getting some errors in that too when calling from unity.

avatar image unity_9543A6F23174F3876D45 · Aug 26, 2021 at 01:07 PM 0
Share

ey, having the same problem did you ever found a solution? @unity_421562675

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

153 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Script Error: Object reference not set to an instance of an object 1 Answer

Script error "The script is an editor script" 1 Answer

como montarse a un coche en unity 5.3 0 Answers

Error CS0103 UnityEngine does not exist 3 Answers

BCE0044: expecting EOF, found '}'. HEEEELP! AYUDAAAAA! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges