Import a picture in a workspace ,Unsupported input format for From Workspace
2 views (last 30 days)
Show older comments
img_path is the selected picture in MATLAB.Image input to system2.
Unsupported input format for From Workspace block 'sy3/From Workspace'. Available formats are double non-complex matrix, a structure with or without time, or a structure with MATLAB timeseries as leaf nodes. All formats require the data to be finite (not Inf or NaN).
3 Comments
Image Analyst
on 10 Jan 2023
Here are the formats it understands.
imformats
What is the format of your image?
Answers (1)
Walter Roberson
on 10 Jan 2023
The From Workspace block does not permit specifying a file name. It has no capacity to read images itself. It does not support any image type.
From Workspace does support 2D arrays of double, but when you use that, the first column of the array must be times, and the remaining columns are the signal values at that time.
The model you show the diagram appears to be using two MATLAB Function Blocks, one of which, System2, appears to be accepting an image path as a signal, and appears to be emitting the image data, and the number of rows and columns, and an additional value that is not clear. The second MATLAB Function Block, System3, appears to be accepting the rows and columns, and mystery parameter, and processing them to do something that results in image data.
The error message you posted is for a From Workspace block named sy3 which does not appear in your model -- not unless sy3 is what is marked as img_path .
If you are trying to use From Workspace to load an image file name, you have a problem that a file name is not a time-based signal, and is not one of the datatypes that From Workspace handles. I suggest that instead you use a String Constant https://www.mathworks.com/help/simulink/slref/stringconstant.html -- which you can set_param at the MATLAB level.
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!