Not Enough Input Arguments
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am attempting to run someone else's code (not well written, I appreciate), it begins as:
function save_data_R13_MFS(build_variables_R13)
close all
% load Soln_Kn_0.05_Na_10_bc_rad_1_sing_rad_0.2.mat
load(build_variables_R13.m)
N_alpha=N_phi;
sing_rad = sing_rad;
N_phi=N_phi;
N=N;
dg=dg;
The aim is to generate graphs of pressure and velocity using the Green's function for velocity from the build_variables_R13.m file, which starts as follows:
function [...
S11, S12, S13 ,...
S21, S22, S23 ,...
S31, S32, S33 ,...
m111, m112, m113,...
m121, m122, m123,...
m131, m132, m133,...
m211, m212, m213,...
m221, m222, m223,...
m231, m232, m233,...
m311, m312, m313,...
m321, m322, m323,...
m331, m332, m333,...
M1, M2, M3, p, v, q, theta,RGrad] = build_variables_R13
However, when I try to run the code it says that there is an issue with the line load(build_variables_R13.m) because there are not enough input arguments. Did anyone have any ideas or suggestions as why this would not be working? I could try and include more of the code, but it gets really messy after this point, I think I just need an idea of why this particular message might be appearing.
0 comentarios
Respuestas (1)
Walter Roberson
el 4 de Ag. de 2019
That is a function. You do not load() it, you execute it and assign outputs to variables.
[Outs{1:44}] = build_variables_R13() ;
And then extract entries from the cell Outs.
I notice that immediately after the load() that variables are used that are not in the workspace and do not correspond to names that are output, such as N_phi. I worry that that might be an internal variable from the function that is not being returned.
I also notice that the name of the build function appears to be passed in to the save* function. How is that being passed? As a character vector that includes a .m extension? That includes a directory path? Handle to anonymous function?
6 comentarios
Walter Roberson
el 7 de Ag. de 2019
The file is called save_data_R13_MFS.m
At some point, you invoke save_data_R13_MFS, passing in something . We need to see the place that save_data_R13_MFS is called -- we need to see exactly what is being passed in.
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!