![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177972/image.png)
Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Why isnt this giving the desired output.
조회 수: 1 (최근 30일)
이전 댓글 표시
The code is supposed to generate cars at different places. However its just generating one which is one the top left corner. Where is the error?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147870/image.png)
OUTPUT
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147873/image.png)
This is what the command line shows.
COMMAND LINE IMAGE
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147875/image.png)
댓글 수: 0
답변 (1개)
Star Strider
2015년 8월 8일
I don’t have your ‘car’ and ‘road’ images, so I made a little green ‘plus’ sign appear in the centre of a yellow pepper. You assign the inserted image just as you would address any other matrix, remembering that in an image, the y-axis is the reverse of a plot y-axis. (I’m attaching the green plus sign image.) Perhaps this will help get you started:
I = imread('peppers.png');
p = imread('dndCopy.png');
I(200+[0:15],260+[0:15],:) = p; % Define ‘I’ Where You Want The ‘car’ (Or ‘+’) To Appear
figure(1)
image(I)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/177972/image.png)
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!