How to run saved code?

조회 수: 8 (최근 30일)
Charlotte Ga
Charlotte Ga 2018년 3월 22일
편집: per isakson 2018년 3월 23일
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
Jan
Jan 2018년 3월 22일
Please post the relevant part of the code and a copy of the complete error message.
Charlotte Ga
Charlotte Ga 2018년 3월 23일
편집: per isakson 2018년 3월 23일
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!

댓글을 달려면 로그인하십시오.

답변 (1개)

James Tursa
James Tursa 2018년 3월 22일
편집: James Tursa 2018년 3월 22일
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
Charlotte Ga
Charlotte Ga 2018년 3월 23일
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...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by