How to run saved code?

8 views (last 30 days)
Charlotte Ga
Charlotte Ga on 22 Mar 2018
Edited: per isakson on 23 Mar 2018
Hello everyone,
I am quite new to MATLAB and although I read through a lot of articles and answeres in the Q&A-section I am still a bit stuck. Today I downloaded a file of several MATLAB-codes (.m) from GitHub https://github.com/reyesaldasoro/Microvessel-Segmentation that I am trying to put into the program so I can apply them to a picture. There is even a desciption underneath the codes on the website but it doesn't say how to get the codes into the program. So I unzipped the file and tried to set it in the MATLAB-path, although I am not quite sure if it worked out - there is still an error occuring when I open the picture and want to run the code. Sometimes it seems that it can't be found or it says that the code is in cell mode (?). So to break this all down: could anyone help me (step by step, for an ultimate beginner wihtout any programming-knowledge) to run the codes from the downloaded file? This would be such a huge help! Thanks already and all the best, Charlotte
  2 Comments
Jan
Jan on 22 Mar 2018
Please post the relevant part of the code and a copy of the complete error message.
Charlotte Ga
Charlotte Ga on 23 Mar 2018
Edited: per isakson on 23 Mar 2018
Hi Jan, it always says: "no data or figure received" as a notification and in the command window:
Undefined function or variable "dataIn".
Error in regionGrowingCells (line 89)
[rows,cols,levs]=size(dataIn);
The Code I'm trying to run is
if nargin==0 %----- no data received, exit
button = questdlg('No data or figure received','Select Input','Single File','Multiple Files in a Folder','Cancel','Cancel');
if strcmp(button(1),'S')
[sfile,pathname]= uigetfile('*.*','Please Select Image to Process (jpg,bmp,tif,...)');
if sfile~= 0
dataInName= strcat(pathname,'/',sfile);
clear sfile pathname;
dataIn= imread(dataInName);
else
disp('File not found');
return;
end
end
% disp('No data or figure received'); finalCells=[];statsObjects3=[];finalCellsIm=[];BW6=[]; help regionGrowingCells return;
end
Thank you for your help!

Sign in to comment.

Answers (1)

James Tursa
James Tursa on 22 Mar 2018
Edited: James Tursa on 22 Mar 2018
Generally you simply copy the unzipped files to a folder that is on the MATLAB path (e.g., your current working folder). Then MATLAB will be able to see the files when you try to invoke the functions.
  1 Comment
Charlotte Ga
Charlotte Ga on 23 Mar 2018
Hi James, thanks for your response! actually that's exactly what I did but the error (you can see it in the comment above) is still occuring...

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!