How to insert a picture in a subsystem mask?

조회 수: 120 (최근 30일)
Daniele Musella
Daniele Musella 2018년 9월 21일
댓글: Sahithya Vinnakota 2022년 12월 17일
I am trying to put an image in a subsystem mask, but this error displays: "Invalid file path passed to image drawing command in block 'subsystem name'. The image file could be not found". The picture file is in the same folder of simulink file and thus I am wondering if it is necessary either to move the image file in another folder or to modify the image dimensions. May anyone help me?

답변 (2개)

VIGNESH V
VIGNESH V 2021년 7월 17일
편집: VIGNESH V 2021년 7월 17일
To insert or mask a subsystem with a image(image which should we masked must be present in the folder where the simulation is stored), you have to right click on the subsystem, then go to [mask], and go to [add icon image] and then browse the image and click ok.
if a error occurs stating(Image file cannot be found. The 'image' drawing command in block '........... ' has an invalid file path.then try the solution given below.
Even i had this problem, There are two possibilities
  • first one is you wouldn't have selected the current folder in which you have simulation file and the image you have to have insert or mask the subsystem.
  • second possibility is that you might have went to the folder but you forgot to click on that folder. In the below image you can see that i have marked a portion in red, it implies that i haven't selected the folder, if i would have selected that folder, the whole path should have displayed in the marked region in the below image. After selecting, try to mask it should work.
hope your problem resolved.
  댓글 수: 1
Sahithya Vinnakota
Sahithya Vinnakota 2022년 12월 17일
Thank you so much! I was making a mistake at the file location.

댓글을 달려면 로그인하십시오.


Ashish Azad
Ashish Azad 2020년 6월 19일
If it is not working there is workaround for this
1)Inside your subsystem file go to edit system mask
2)Go to the "Icon & Ports" tab and inside the "Icon drawing commands box", write this command
image("C:\Users\ashis\Downloads\imagename.jpg")
You can get the absolute path of image in properties of image
Your image name and file format can be different, so write accordingly to it.
This should work fine

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by