小编Unb*_*ger的帖子

提高App Designer UI元素的刷新率

我目前正在尝试显示我在Matlab应用程序设计器应用程序中通过串口接收的数据.我正在遭受线性仪表的极差刷新率(~1 Hz).

仪表的值由固定速率定时器更新,定时器设置为30Hz.计时器回调中的时间戳打印显示我以正确的频率调用它.我的计算机非常强大,任务管理器没有显示任何高负载的迹象 - 实际上,MATLAB应用程序几乎不消耗任何CPU时间.它实际上不仅仅是仪表而是所有UI元素.

所以我的猜测 - 或更好:我的希望 - 是刷新率必须有一些硬性上限.但是,官方文档没有提供有关如何更改此内容的任何提示.

我的MATLAB版本是R2016b.

所以我的问题:

  • 这是用R2017a修复的吗?

  • 如果没有:我可以做些什么,即摆弄MATLAB内置文件?

这是一个MCV示例,演示了这个问题:

classdef testapp < matlab.apps.AppBase

% Properties that correspond to app components
properties (Access = public)
    UIFigure                  matlab.ui.Figure
    andwatchhowthisstartstospinsmoothlyGaugeLabel  matlab.ui.control.Label
    andwatchhowthisstartstospinsmoothlyGauge  matlab.ui.control.SemicircularGauge
    KeepturninghereKnobLabel  matlab.ui.control.Label
    KeepturninghereKnob       matlab.ui.control.Knob
end


properties (Access = private)
    tim_the_timer
    i = 0;
end

methods (Access = private)
    function app = refreshMeter(app, ~,~)
        % display timestamp
        datestr(now,'HH:MM:SS.FFF')

        % update the gauge
        app.andwatchhowthisstartstospinsmoothlyGauge.Value = app.i;
        app.i = app.i + 1;
        if app.i > 100
           app.i …
Run Code Online (Sandbox Code Playgroud)

matlab user-interface refresh data-visualization matlab-app-designer

7
推荐指数
1
解决办法
1411
查看次数

Android 蓝牙 LE - 读取浮点特性

我正在尝试读取连接的蓝牙 LE 设备(Genuino 101)的浮动特性。出于测试目的,设备提供带有硬编码值“55.3”的 FloatCharacteristic。虽然我能够收到一个以某种方式类似于浮点数的字符串,但我无法读取实际的浮点值。
这是处理字符串的代码片段:

// For all other profiles, writes the data formatted in HEX.
        final byte[] data = characteristic.getValue();
        if (data != null && data.length > 0) {
            final StringBuilder stringBuilder = new StringBuilder(data.length);
            for(byte byteChar : data)
                stringBuilder.append(String.format("%02X ", byteChar));
            intent.putExtra(EXTRA_DATA, new String(data) + "\n" + stringBuilder.toString());
        }
Run Code Online (Sandbox Code Playgroud)

这是直接从android 开发者主页的https://developer.android.com/samples/BluetoothLeGatt/index.html BLE 演示项目复制的。然后此代码段处理意图:

private final BroadcastReceiver mGattUpdateReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        System.out.println("Broadcast received");
        final String action = intent.getAction(); …
Run Code Online (Sandbox Code Playgroud)

android bluetooth-lowenergy android-bluetooth gatt

5
推荐指数
1
解决办法
1692
查看次数

可以(a == 1)&&(a == 2)&&(a == 3)评估为真?(它有用吗?)

受到另一个关于java脚本语言的问题的启发.可以表达

 (a==1)&&(a==2)&&(a==3)
Run Code Online (Sandbox Code Playgroud)

在C++中评估为true?(如果是的话,它真的有用吗?)

c++ operator-overloading

2
推荐指数
2
解决办法
908
查看次数