improfile(), How can I use a .fig format with improfile?
Show older comments
Hello all,
I have a .fig file that I want to make multiple profiles for, but improfile doesn't like when I try to pass it as an input.
[x,y,I] = improfile; works when I have a figure already open, but I want to take the initial x that I draw and make additional profiles the next pixel over. So my code looks like this:
figure(5)
imagesc(X,Y,Q,[0 1])
colormap(TSPcolormap);
colorbar;
[Px,Py,I] = improfile; % draw initial profile
for k=1:5
[Qprof(:,k)] = improfile(figure(5), Px+k ,Py);
end
The .fig file is a matrix 600x800 and has a color map so if I try to save it as anything else it loses the scaling and shows up as intensity or RGB instead. So is there a way to tell improfile to read in the current figure?
Also I have tried replacing figure(5) with gcf, gca, etc. To use improfile with initial x and y would have to pass an image through and cannot leave it blank.
Thanks
Accepted Answer
More Answers (2)
Image Analyst
on 15 Jul 2014
0 votes
Pass Q into improfile() instead of figure(5).
Ryan
on 15 Jul 2014
0 votes
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!