Trouble reading an image using imread in embedded matlab function and trouble with "from-workspace" block

I am trying to read a JPG image in from a file and input it to the serial send block in the ICT. I can read the image in with matlab using the imread command but when I put it in an embedded matlab function it errors saying it is not supported in standalone and I need to use coder.extrinsic. I have tried to use it but unsuccessfully. So I just read it into the matlab workspace and then tried to input it to the serial send block using the from workspace command, but I can't figure out how to use the name correctly. So my question is two-fold: 1. How do I use coder.extrinsic with the imread command. My file name is 'lunar.jpg'. 2. If I have it in a matlab variable called 'lunarImage' what do I put in the 'data' field for the From workspace block? If I use lunarImage, it says the format is unsupported (it is a 640 x 480 matrix). I have tried setting the structure using the .time field and the .dimension field, but I must be doing that wrong too. Can anyone show me the correct way to use these two functions (blocks)?

Answers (0)

Asked:

on 13 Jan 2012

Community Treasure Hunt

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

Start Hunting!