Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 在图例中插入文本_Matlab - Fatal编程技术网

Matlab 在图例中插入文本

Matlab 在图例中插入文本,matlab,Matlab,我有一个三行文字,我想在我的情节中插入一个图例 textLegend: 'Sentence 1' 'Sentence 2' 'Sentence 3' 可能有一句话 Sentence1 = 'pressure, Re= 10e5, std Re = 4e3' 每当我输入图例(textLegend)时,我得到 我猜,您想使用: legend(myCell) 您可以在其中使用单元格数组,如: myCell={'My first sentence','pressure, Re= 10e5, std

我有一个三行文字,我想在我的情节中插入一个图例

textLegend:
'Sentence 1'
'Sentence 2'
'Sentence 3'
可能有一句话

Sentence1 = 'pressure, Re= 10e5, std Re = 4e3'
每当我输入图例(textLegend)时,我得到


我猜,您想使用:

legend(myCell)
您可以在其中使用单元格数组,如:

myCell={'My first sentence','pressure, Re= 10e5, std Re = 4e3'}
好吧,如果你像这样使用它,它应该会工作,但你得到的错误消息似乎来自其他地方。据我所见,您使用的是函数SUFFINDEX,该函数获取一个单元格数组。我建议在调用函数SUFFINDEX的行中停止调试它。 也许您可以共享更多的代码,如果这没有帮助…

带有单元格数组的图例(textLegend)应该是正确的(假定您使用的是内置函数)

再次检查您是否未使用图例作为变量名。我可以通过定义一个名为legend(legend=[1 2 3]或类似)的变量,然后向它提供一个单元格数组来复制这个错误


Matlab假设legend(textLegend)是指变量legend,而不是函数,试图调用子索引,失败,因为您无法使用字符串单元格数组为矩阵编制索引。

能否提供绘图和所用函数的简单示例?我使用简单绘图函数查看升力和阻力曲线。图例就像我给你看的一样。请发布你用来显示图例的确切代码。
myCell={'My first sentence','pressure, Re= 10e5, std Re = 4e3'}