Matlab程序错误,跪求高手解答

错误提示如下:???Undefinedfunctionorvariable'ROOTDIR'.Errorin==>realField1phExampleat29grdec... 错误提示如下:
??? Undefined function or variable 'ROOTDIR'.

Error in ==> realField1phExample at 29
grdecl = fullfile(ROOTDIR, 'examples', 'grids', 'GSmodel.grdecl');

出错的程序源码如下:

%% Pressure Solver: Example of a Real Field Model
% In the example, we will solve the single-phase pressure equation
%
% $$\nabla\cdot v = q, \qquad v=\textbf{--}\frac{K}{\mu}\nabla p,$$
%
% using the corner-point geometry from a real North Sea field.
%
% <html>
% The purpose of this example is to demonstrate how the mimetic flow solver
% can be applied to compute flow on a real grid model that has degenerate
% cell geometries and non-neighbouring connections arising from a large
% number of faults, eroded layers, pinch-outs, and inactive cells. A more
% thorough examination of the model is given in a
% <a href="../../grids/html/realFieldModelExample.html">separate example</a>.
% </html>
%
% For confidentiallity reasons, we will not use real data for rock
% parameters and well paths. Instead, synthetic permeability data are
% generated by (make-believe) geostatistics and vertical wells are placed
% quite haphazardly throughout the domain.
%
% <html>
% Experimentation with this model is continued in <a
% href="../../2ph/html/realField2phExample.html">
% another example</a>, in which we solve a simplified two-phase model.
% </html>

%% Check for existence of input model data
grdecl = fullfile(ROOTDIR, 'examples', 'grids', 'GSmodel.grdecl');
if ~exist(grdecl, 'file'),
error('Model data is not available.')
end

%% Read and process the model
% We start by reading the model from a file in the Eclipse formate
% (GRDECL). As shown in <realFieldModelExample.html the more thorough
% discussion>, the model has two components, of which we will only use the
% first one.
grdecl = readGRDECL(grdecl);
G = processGRDECL(grdecl); clear grdecl;
G = computeGeometry(G(1));

%% Set rock and fluid data
% The permeability is lognormal and isotropic within nine distinct layers
% and is generated using our simplified 'geostatistics' function and then
% transformed to lay in the interval 200-2000 mD. The single fluid has
% density 1000 kg/m^3 and viscosity 1 cP.
gravity off
K = logNormLayers(G.cartDims, rand(9,1), 'sigma', 1.5);
K = 200 + (K-min(K))/(max(K)-min(K))*1800;
rock.perm = convertFrom(K(G.cells.indexMap), milli*darcy); clear K;
fluid = initSingleFluid('mu' , 1*centi*poise , ...
'rho', 1000*kilogram/meter^3);

clf,
plotCellData(G,log10(rock.perm),'EdgeColor','k');
axis off, view(15,60), h=colorbar('horiz'); zoom(2.5),
cs = [200 400 700 1000 1500 2000];
caxis(log10([min(cs) max(cs)]*milli*darcy));
set(h, 'XTick', log10(cs*milli*darcy), 'XTickLabel', num2str(round(cs)'));
以上只是出错的代码,后面的代码没有附上来,哪位高手帮帮我,问题解决之后我再加分,谢谢
第二十九行:grdecl = fullfile(ROOTDIR, 'examples', 'grids', 'GSmodel.grdecl');
,matlab有没有“ROOTDIR”命令?另外,我要打开的数据文件的路径如下:D:\matlab\mrst-2010a\mrst-2010a\examples\grids\GSmodel.grdecl。我的问题可能没有描述清楚,朋友也可以加我QQ好友675622075,再次谢过
展开
 我来答
matlabguy
2010-10-18 · TA获得超过346个赞
知道小有建树答主
回答量:209
采纳率:0%
帮助的人:301万
展开全部
matlab错误不都告诉你没有ROOTDIR这个东西了么,你把路径自己换上再试试看吧。
意法半导体(中国)投资有限公司
2023-06-12 广告
单片机,即单片微控制器,也称为单片微型计算机,是将中央处理器(CPU)、存储器(ROM,RAM)、输入/输出接口和其他功能部件集成在一块 在一个小块的集成电路上,从而实现对整个电路或系统的数字式控制。单片机不是完成某一个逻辑功能的芯片,而是... 点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式