I'm using the following script:
http://se.mathworks.com/matlabcentral/fileexchange/48576-circulargraph
to create an schemaball from a correlation matrix (my related earlier question can be found here). When I try to run the script (e.g. example.m file) I get the following error (click on the image to enlarge it):
I'm using Matlab R2014a. What do I need to do to get this working?
As #EBH already mentioned it seems I can't use this script on Matlab R2014a.
Related
I'm trying to use roipoly(I) to allow user selection of a region within an image. When I run the example code from MATLAB documentation:
img = imread('eight.tif')
imshow(img)
bw = roipoly(img)
I'm getting the following error:
Undefined function or variable 'iptPointerManager'.
with several other error lines after, but i'm quite convinced that the one above is the issue.
I have MATLAB R2016a on Windows 7 with image processing toolbox installed and working.
Resetting the path using restoredefaultpath worked.
I want to use fig2texPS to export plots from MATLAB to LaTeX. I copied the the script to D:\Eigene Dokumente\MATLAB\fig2TexPS and added this folder as a path in MATLAB. Unfortunately, I receive the following error:
>> fig2texPS()
Undefined function 'find' for input arguments of type 'matlab.graphics.chart.primitive.Line'.
Error in fig2texPS (line 526)
lsh = double(find(handle(lshandles),'-class','graph2d.lineseries')); % find plots
PS: I use a version of the script which was updated in order to work with pdtlatex (http://pastebin.com/xK6KxxBT) that I found in the MATLAB Central File Exchange. The same error also occurs when I use the original script.
This might not be the answer you are looking for, but there is the marvelous matlab2tikz that does the job of conversion of figures quite nicely, which you could use as an alternative to fig2texPS.
I also use the function fig2texPS.m and it works very well. It might be an answer for your question to use an older version of Matlab. I am using 2013b and it works. While I have tried this function with Matlab 2015a, I was getting the same error message.
I hope my answer helps you with your problems.
I am new to Matlab and trying to save my current figure to file. So, I have followed the official documentation at http://www.mathworks.co.uk/help/matlab/ref/savefig.html#inputarg_h and entered the following into Matlab:
figure;
surf(peaks);
savefig('PeaksFile.fig');
close(gcf);
However, I get the following error:
Undefined function 'savefig' for input arguments of type 'char'.
If I type in:
help savefig
I get the following error:
savefig not found.
Any ideas on what's going on? I would have thought that savefig comes with all releases of Matlab rather than requiring any add-ons. The version of my Matlab is 2013a.
It looks as though savefig is not implemented in Matlab version earlier than 2013b (from some experimentation and a comment at the end of http://www.mathworks.com/matlabcentral/fileexchange/10889-savefig). Instead, use saveas(h,'filename.ext'), which is documented here http://www.mathworks.co.uk/help/matlab/ref/saveas.html and is certainly included in 2012a.
You're using R2013a, while savefig was released in R2013b. I can't test if the functionality is identical as I don't have R2013b (or newer) on this computer, but you might try the savefig-function on the File Exchange, or other alternatives available in the R2013a-release.
The two answers are great. Another option which I believe has been around for many, many years is to use the print command:
print -f1 -djpeg bob.jpg
The -f1 is the figure number and obviously bob.jpg is the filename to which you want to write. I have code going back to 2007 using that but I am sure it goes back earlier than that. So it should work with pretty much any version you are using.
For that matter, using print, you can write PS, EPS, TIFF, PNG as well as JPG.
Im trying to perform centerline extraction for cardiac CT images, and I am stuck. I need an example code that uses the "fast marching method". I got this code from mathworks.
I1=im2double(imread('se036.png'));
SpeedImage=I1*1000+0.001;
SourcePoint=[800;803];
DistanceMap= msfm(SpeedImage, SourcePoint);
figure
imshow(DistanceMap,[0 3400]) StartPoint=[9;14];
ShortestLine=shortestpath(DistanceMap,StartPoint,SourcePoint);
hold on
plot(ShortestLine(:,2),ShortestLine(:,1),'r')
But I get error message Undefined function 'msfm' for input arguments of type 'double'.
It appears you are trying to use the Matlab File Exchange submission Accurate Fast Marching but you haven't properly installed the code. The function file you downloaded, msfm.m, needs to be in a folder on your path or in the current working directory.
This function bwmorph(Img,'skel',Inf) return the skeleton of a binary image.
What I'm looking for is the algorithm used by this function to do it manualy ?
The documentation gives an overview of the algorithm (scroll down a ways).
If you want to see the actual code within a function in MATLAB, you can try using the TYPE command:
type bwmorph %# Command form
type('bwmorph.m') %# Function form
Keep in mind, this will not work on all MATLAB functions. You may get a message that says the function is a built-in function, in which case the code will not be displayed. You can also try opening the file in the MATLAB Editor using the EDIT command:
edit bwmorph.m %# Command form
edit('bwmorph.m') %# Function form