Guy on Simulink

Simulink & Model-Based Design

Creating iPhone and iPad Apps with Simulink

前几天,一个用户告诉我:如果我们可以使用simulink为智能手机编程应用程序,这将是很酷的金宝app

Guess what my answer was:Of course you can!

Simulink Support Packages for Apple iOS and Android

Yes, you heard it right. If you have a Simulink license, you can download theSimulink Support Package for Apple iOS,或者如果你更喜欢金宝appSIMUL金宝appINK®支持包for Android™

Simulink Apple iOS library

由于他主要在苹果生态系统中工作,我没有,我向我的同事Mariano Lizarraga Fernandez本周成为客人博主,并描述了他试图为他的iPhone构建一个应用程序的第一个经历。

入门

Before you get started, make sure you have the following:

  • 运行OS X Yosemite或El Capitan的Apple计算机和Simulink安装了。金宝app
  • Xcode 7.x.
  • 一个免费的Apple开发人员帐户。
  • Simulink Support Package for Apple iOS
  • 运行iOS 8.x或9.x的iOS设备。

Make sure that when you install the Support Package you completely follow the setup instructions包括获取用于签署申请的证书。You need to make sure, in your Xcode preferences, that your certificate is valid and that the identifier matches that of your application. In the following picture,CBDEMO.is the name of the Simulink model:

Xcode Configuration

对于您的第一个模型,如图所示入门文档页面,简单的测试是获取相机视频,并在屏幕上显示。您可以通过执行直接访问此演示iosGettingStartedExamplein MATLAB.

在运行这个模型之前,打开模型的配置uration Parameters, and in the Hardware Implementation section make sure the Hardware Board is configured for Apple iOS Devices and that your iOS Device is shown in the Target Hardware Resources:

iPad目标的模型配置

现在到了有趣的部分......

为了让您了解什么样的应用程序可以创建,我们决定从一个例子开始Computer Vision system Toolbox交通警告标志识别

模型作为发货从文件系统加载视频,并执行识别停止并产生交通标志。为了使IOS目标调整,我们只需要更换源和汇。我们决定使用而不是刚替换块。变体子系统to switch between a simulation-only version, and a deployable version.

对于来源,我们使用iOS camera sourceblock. Since this source only produces 8-bit unsigned integers, we need to modify: (1) How the来自多媒体文件block produces the output so it too results in 8-bit unsigned integers; and (2) Convert the 8-bit frame to single precsision floating point one using theim2single功能。

Simulink Apple IO金宝appS库的视频源

类似地,对于水槽变体,自iOS Video Display块只接受8位无符号整数,我们使用单个精度浮点将处理的图像转换为8位无符号整数使用IM2UINT8.function

Video Sink for Simulink Apple iOS library

这是一个在ipad mini上的行动中的样子:


https://youtu.be/AMLdghppCn4

Now it's your turn

您将为iPhone或iPad创建什么样的应用程序?降噪耳机?盲人驾驶助手?

If you create a cool app, submit it toMatlab Central.文件交换让我们知道在下面的评论中。

|
  • 打印
  • 发送电子邮件

Comments

要发表评论,请点击here要登录您的MathWorks帐户或创建新的。