How can I connect a device while using the matlab app environment?

조회 수: 2 (최근 30일)
Stephen Johnston
Stephen Johnston 2020년 3월 17일
편집: Adam Danz 2020년 3월 18일
Hi, I'm trying to connect an arduino device into matlab. When I write my own personal script, the device() function works fine and I'm able to connect. However when I use a graphical interface through matlabs app generator, I get an error.
Here's my code and my error. Matlab crashes every time after giving this error. As you can see I'm declaring it at startup, meaning that this is the first thing the program initializes.
The code crashes only when I'm running the app environment and I can easily declare the device in a script. Let me know if more information is needed.
Thank you!
  댓글 수: 6
Stephen Johnston
Stephen Johnston 2020년 3월 18일
@Adam Danz
Thank you very much! I wasn't aware that you had to declare the variable differently inside the app environment. My code works now and here's a photo of what it should have looked like.
This saved me a gigantic headache and I very much appreciate it.
Adam Danz
Adam Danz 2020년 3월 18일
편집: Adam Danz 2020년 3월 18일
Glad I could help clarify things.
@Subhamoy Saha, please copy your comment to the answers section and perhaps expand upon it a bit.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Application Deployment에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by