create a grid fuction
2 views (last 30 days)
Show older comments
I wanna write a function .mfile to create a computational grid.
function kgrid = test_environment
Nx = 10;
Ny = 10;
Nz = 10;
dx = 0.001;
dy = 0.001;
dz = 0.001;
kgrid = test_environment (Nx, dx, Ny, dy, Nz, dz);
why do i get this error: Too many input arguments.????
0 Comments
Answers (3)
Iain
on 29 May 2013
It is because in your function declaration, you do not define inputs.
function kgrid = test_environment(nx,dx,ny,dy,nz,dz)
Lets you input those parameters.
Look at the help on varargin and nargin if you want optional arguments.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!