MATLAB 帮助中心
Specify image to display as annotation
setImage(a,img)
setImage(a,img) changes the annotation to display only the specified image.
a
img
example
collapse all
This example shows how to add an image to your model, such as a logo, by creating an image-only annotation programmatically.
Open the example. Then, open a new model and create an annotation in it.
open_system(new_system) a = Simulink.Annotation(gcs,'This is an annotation.');
Change the annotation to display only the specified image.
img = fullfile(pwd,'drivingCar_24.png'); setImage(a,img)
Simulink.Annotation
Annotation, specified as a Simulink.Annotation object.
Image filename, specified as a character vector or string scalar. The filename must contain the file extension and can include a partial path, complete path, relative path, or no path.
Data Types: char | string
char
string
Introduced in R2014a
Simulink.Annotation | view | delete
view
delete
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处