问题标签 [matlab-uitable]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
380 浏览

matlab - 在uitable中选择一行时,它说“尝试引用非结构数组的字段”

问题是:

我需要点击一个Pushbottom时,会选择下一行,相关代码是:

openningFunctionmtable如下:

0 投票
1 回答
134 浏览

matlab - 通过鼠标单击获取日期,matlab

我想从日历中获取两个日期。matlab函数是

或者

但是如何让用户点击这两个日期。

0 投票
3 回答
2797 浏览

matlab - Uitable、cellSelectionCallback 和修改数据集

我的代码真的太长了,不能在这里发布,即使是一小部分。所以我只要求一两件事:在我看来,在修改 uitable 'ht' 的 'Data' 属性时:

触发“cellSelectionCallback”例程(因为选择很可能确实发生了变化),但不是在修改数据集后立即触发。

  1. 这是真的 ?
  2. 有没有办法防止这种行为?

谢谢 !

0 投票
1 回答
566 浏览

java - Corruption in uitable header when using setValue on the scrollbar

I am trying to create a table in MATLAB where I can change the scroll position programmatically. I created a uitable and extracted the handle of the Java UITablePeer object (designated here as htable).

I then got the handle for the UIScrollbarPane object using:

At this point, the figure looks like this (my actual table is more complicated, this is just something I made as an example):

before

The box at the lower left corner of the table is a pushbutton. When its callback is triggered, it uses the setValue method to change the scrollbar location, e.g.

After this, the table looks like this:

After

As you can see, the top of the table becomes corrupted. I've tried using the refresh function or repaint method, but they don't seem to help; the only way to "fix" this is to move another window (by dragging or Alt-Tabbing) such that the table is completely covered, and when I switch back to the table it's OK. Obviously, this isn't really an optimal solution.

Can anyone suggest a way to prevent or fix this?

Thanks

0 投票
3 回答
218 浏览

string - 是否可以将字符串与一系列数字连接起来?

我有一个字符串(例如'STA'),我想制作一个单元格数组,它将我的字符串与从 1 到 X 的数字串联起来。

我希望代码在下面执行类似于前循环的操作:

我希望最终结果采用 {<1xNum cell>} 的形式

(我想将此设置为 ColumnFormat 数组中的 uitable)

0 投票
1 回答
765 浏览

matlab - Matlab:适用于逻辑单元和默认值“真”

我正在尝试构建一个合适的 1x2。

Cell(1,1) 格式是“逻辑的”;单元格(1,2)是“字符”

当我运行我的文件时:当我按下复选框取消选中 cell(1,1) 时,没有任何反应。如果我没有将单元格默认设置为 true - 一切都很好(即删除该行:

0 投票
1 回答
3395 浏览

string - 如何在matlab中用字符串动态填充矩阵?

我想通过 打印一个表格uitable,表格条目的数据存储在一个名为plot. 每个条目都应该是一个字符串,由 2 个字符组成,即p0, u1... 矩阵应该填充在两个嵌套的 for 循环中。

但是每当我想将字符串存储为元素时。即plot(i,j)='a1'我得到错误

另一方面,当我在开始时完全初始化矩阵时,即

它似乎工作得很好。

我将非常感谢有关该问题的任何想法。有什么方法可以解决单元阵列的问题吗?

0 投票
0 回答
169 浏览

matlab - 在鼠标向上触发 matlab uitable cellselection 回调

我有一个带有复选框列的 uitable。我想切换每个选定单元格的复选框状态。显然,当用户仍在向选择中添加单元格时执行回调函数时,这不起作用。它应该在用户释放鼠标之前执行。

然而,每次选择区域变化时,单元格选择回调函数的正常行为都会触发。

如何改变这种行为?

一个

0 投票
2 回答
7135 浏览

matlab - 在 Matlab 中设置不同的单元格格式

我正在寻找一种在 Matlab 的一列中处理不同类型数据的方法uitable

通常uitable用于将整列设置为相同的数据类型,例如logical(给出复选框)、char(给出左对齐文本)、numeric(给出右对齐数字)或 1xn-cell-array(给出带有不同的选择)。

它是使用 的columnformat属性设置的uitable,例如

您可以在 matlab 文档中找到一个示例。

我正在寻找一种方法来设置单个单元格的格式以实现如下所示:

不同的单元格格式

0 投票
1 回答
67 浏览

matlab - 我希望用户浏览文件,但它会影响我的脚本

我正在使用 MATLAB。

我有一个名为“cobat”的文件。Cobat 是一个 *txt 文件,制表符分隔,由 3 列组成,所以它是一个表格。我将它手动加载到这个脚本中:

我希望用户浏览他们自己的文件。我该怎么做?此代码是否正确:

这是我的问题:

  1. 我认为它仅适用于文本文件,而不是制表符分隔(表格)。我想我必须使用uitable,但我不明白如何实现它,因为应该加载文件(cobat)。

  2. 而且,如果它已经实现,我不能在我的脚本中写“cobat”,如下所示:

[g c] = kmeans(cobat,k,'dist','SqEuclidean'); y = [cobat g]

那我必须把“cobat”改成什么名字?

谢谢你。