我是靠谱客的博主 着急山水,这篇文章主要介绍matlab builder for java和保存路径有关吗_如何在Matlab中将通用文件名称作为函数参数包含在路径位置中?...,现在分享给大家,希望可以做个参考。

关于我想要的内容摘要:如果我将文件名作为函数的参数,如何将该文件名包含在路径位置中,使得路径位置中的文件名是一个用户输入的。如果你不明白我在说什么,然后阅读下面的解释:如何在Matlab中将通用文件名称作为函数参数包含在路径位置中?

二次说明:

我提出这要求呼叫被叫CMG软件的通用功能。该软件需要一个.dat文件,其名称作为函数中的参数,其参数中的通用名称为ReservoirModel_CMGBuilder。正如您在下面的部分代码中看到的,这个ReservoirModel_CMGBuilder文件保存在我输入的路径位置的文件夹中。但是,问题在于文件名是用引号引起的,所以它不能识别代码中的文件名。我想要的是从用户那里获取CMG所需的.dat文件名的名称,并将其存储在名称ReservoirModel_CMGBuilder中,然后在路径位置使用该名称来提取该文件。

同样我想为Reportq_rwd和Reportq_rwo做这件事。我怎样才能做到这一点?

function [q_yearly,Swav_yearly]=q_from_CMG_general(nModel,nCell,T,ReservoirModel_CMGBuilder,poro_models_gslib_file,perm_models_gslib_file,Reportq)

ReservoirModel_CMGBuilder=[ReservoirModel_CMGBuilder '.dat']; % string concatenation

Reportq_rwd=[Reportq '.rwd'];

Reportq_rwo=[Reportq '.rwo'];

poro_models=gslib_file_to_matlab_var(nModel,nCell,poro_models_gslib_file);

perm_models=gslib_file_to_matlab_var(nModel,nCell,perm_models_gslib_file);

%% loop to run all nModel

for model_no=1:nModel

%% Writing the porosity and permeability model one at a time in .inc file, which will be read and will work as input to porosity and permeability models in CMG

dlmwrite('poro_model.inc',poro_models(:,model_no),'delimiter','n');

dlmwrite('perm_model.inc',perm_models(:,model_no),'delimiter','n');

%% Prior to driling an exploratory well or acquiring a seismic with just 5 producing wells

%# Calls CMG

system('mx200810.exe -f "C:Documents and SettingsHSingh2DesktopWorkModel - SGEMS, CMG and MATLABReservoirModel_CMGBuilder"') % Calls CMG

%# Calls parameter report file and generates output file

system('report.exe /f Reportq_rwd /o Reportq_rwo')

2010-10-06

Pupil

最后

以上就是着急山水最近收集整理的关于matlab builder for java和保存路径有关吗_如何在Matlab中将通用文件名称作为函数参数包含在路径位置中?...的全部内容,更多相关matlab内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(150)

评论列表共有 0 条评论

立即
投稿
返回
顶部