필터 지우기
필터 지우기

how i can create function file for this program

조회 수: 1 (최근 30일)
aswathy
aswathy 2014년 9월 27일
댓글: aswathy 2014년 9월 29일
when i execute this file i got error
??? Error: File: slic.m Line: 92 Column: 1 Function definitions are not permitted in this context.
what can i do? how can i got correct output? how can i write test file? please help me to write this code?
how i can do this sir please help me sir it was my project's first step i didnt get even the 1st step output now i got function test_slic | Error: Function definitions are not permitted in this context. this error

채택된 답변

Image Analyst
Image Analyst 2014년 9월 27일
I think we talked about this before. You need to either
  1. Put the name of the file following the word function in there, like "function test_slic()" so that you can have both functions in the same test_slic.m file, OR
  2. Put slic() into its own slic.m file and the test routine into its own file called test_slic.m
  댓글 수: 5
Image Analyst
Image Analyst 2014년 9월 28일
Alright, I did it for you. I just followed the explicit directions I gave you in your duplicate post - make them two separate mfiles. They are attached. Now I don't know what any of this does since I didn't dive into it, I just got it running. The files are attached and produce the image below. I really suggest that you look at this link http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab because having two m-files, one that is a function and one to call that function, is a really super basic skill that you will need to learn in order to advance in using MATLAB.
Please mark the Answer as Accepted. Now since you have two posts on the same thing, I'll go over to your other one and paste this answer there too.
aswathy
aswathy 2014년 9월 29일
thank you sir thank you very much

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by