Re: matlab a function in m-file
- From: "Nasser Abbasi" <nma@xxxxxxxxx>
- Date: Sat, 31 Mar 2007 05:11:55 -0700
"akira32.comp.soft-sys.matlab" <rikcuo32@xxxxxxxxxxxx> wrote in message
news:1175342475.318186.225890@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I write a function called improd in m-file(bb.m).
% in bb.m file
function [ p, pmax, pmin ,pn ] = improd ( f, g )
% help22
fd=double (f);
gd=double (g);
p=fd.*gd;
pmax=max(p(:));
pmin=min(p(:));
pn = mat2gray(p);
But when I call improd function,it appears the error about Undefined
function improd.
??? Undefined command/function 'improd'.f=[1 2 ; 3 4];
g=[1 2 ; 2 1];
improd(f,g);
How do I let matlan know that I have declare a fuction in m-file and I
want to use the function?
btw, the standard is to name the m file as the same name of the function
inside the m file.
Try to do that first. i.e. rename the m file as improd.m
If you still have problem then try to update your Matlab path to include the
folder where this m file is located and try again to call it.
File->Set Path
Nasser
.
- Follow-Ups:
- Re: matlab a function in m-file
- From: akira32.comp.soft-sys.matlab
- Re: matlab a function in m-file
- References:
- matlab a function in m-file
- From: akira32.comp.soft-sys.matlab
- matlab a function in m-file
- Prev by Date: matlab a function in m-file
- Next by Date: FFT of stock market data?
- Previous by thread: matlab a function in m-file
- Next by thread: Re: matlab a function in m-file
- Index(es):