Not Enough Input Arguments
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2019-8-4
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 个评论
Walter Roberson
2019-8-7
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!