Extract values from a fig file?
显示 更早的评论
Hi, I have a file like "Example.fig" that contains a picture
and I want to extract the values of each pixel and put them in a matrix form so I can work with them
What can I do?
采纳的回答
更多回答(1 个)
Vinayak Agrawal
2023-6-9
0 个投票
Hi MementoMori,
According to me these commands will help you get the results
>>s=load('Example.fig','-mat'); %opening the figure
>> values=s.hgS_070000.children(1).children.properties.CData; %storing pixel values
>> fig = imagesc(values); %verifying by plotting the ‘values’ which are our pixel values
You can see the pixel values by double clicking on ‘values’ variable created in your workspace
You can refer to these documents also-
- extracting data series from *.fig file - MATLAB Answers - MATLAB Central (mathworks.com)
- matlab - plot matrices in desired colors - Stack Overflow
Hope it helps!
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

