copy contents of file with variable number in Matlab
input : transient.case
output: transient_1.case, transient_2.case, transient_3.case ...
************transient.case
FORMAT
type: ensight gold
GEOMETRY
model: solution.pval.unsteady_1.geo
VARIABLE
scalar per node: density solution.pval.unsteady_*.density
vector per node: v solution.pval.unsteady_*.v
scalar per node: pressure solution.pval.unsteady_*.pressure
scalar per node: temperature solution.pval.unsteady_*.temperature
TIME
time set: 1
number of steps: 1
filename start number:2
filename increment: 1
time values: 1.0319174484984 1.8385297551528
*******************
where, filename start number:2,
is the same as filename
**************************code.m
n=10;
fileinfo = importdata('transient.case',';');
for i=1:n
filename=sprintf('transient_%d.case',i);
a=cell2mat(fileinfo(13));
idx=find(a==':');
fileinfo(13)=cellstr(strrep(a,a(idx+1:end),num2str(i)));
filePh = fopen(filename,'w');
fprintf(filePh,'%s\n',fileinfo{:});
fclose(filePh);
end
*****************
copy contents of file with variable number in Matlab的更多相关文章
- How to create functions that can accept variable number of parameters such as Format
http://www.chami.com/tips/delphi/112696D.html Sometimes it's necessary to pass undefined number of [ ...
- Variable number of arguments (Varargs)
A parameter of a function (normally the last one) may be marked with vararg modifier: fun <T> ...
- Solved Unable to copy the source file ./installer/services.sh to the destination file /etc/vmware-t
Sometimes when you intall vmwaretools there will be some problems such as "Unable to copy the s ...
- ORA-19502: write error on file "xxxxx", block number xxxx
错误现象: 在ORACLE 10g下为表空间IGNITE_EGVSQL01增加数据文件时,报如下错误: SQL> ALTER TABLESPACE IGNITE_EGVSQL01 AD ...
- MySQL_ERROR 1231 (42000) at line XX in file 'file_name' Variable 'time_zone' can't be
类似的错误信息如下 ERROR 1231 (42000) at line 10370 in file: '/root/sql/ultrax_170322.dmp': Variable 'time_zo ...
- Lua 变长参数(variable number of arguments)
lua变长参数 function add ( ... ) for i, v in ipairs{...} do print(i, ' ', v) end end add(1, 2, 'sdf') lu ...
- [翻译] Macros with a Variable Number of Arguments - GCC
可变参数宏(Variadic Macro) 在1999年的ISO C标准中,可以声明一个像函数一样接受可变参数的宏.定义这种宏的语法与函数的定义相似.这是一个例子: #define debug(for ...
- EmWebAdmin 生成流程分析
继上一篇的简略的说明 EmWebAdmin 的地址以后下载,生成之后,这一篇讲一下该模板的生成流程 // 上一篇地址: http://www.cnblogs.com/chenfulin5/p/6856 ...
- Visual Studio - File Properties (Build Action, Copy to Output Directory)
Ref: MSDN (https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/0c6xyb ...
随机推荐
- 2015南阳CCPC G - Ancient Go dfs
G - Ancient Go Description Yu Zhou likes to play Go with Su Lu. From the historical research, we fou ...
- TGraphicControl和TCustomControl自绘过程的理论解释
TGraphicControl = class(TControl) // 这个类实在是简单,因为所有事情都已经委托给它的父Win控件了,只要管自己即可 private FCanvas: TCanvas ...
- Ubuntu下用命令行快速打开各类型文件(转)
nautilus /media/pm/文档/book/system/必读nautilus /media/pm/文档/book/android/ndk 内核/framerwork/android wai ...
- Tiny4412 开发板 编译环境搭建【转】
本文转载自:http://blog.csdn.net/beijiwei/article/details/51055369 版权声明:本文为博主原创文章,未经博主允许不得转载. /*********** ...
- Bing Maps进阶系列二:使用GeocodeService进行地理位置检索
Bing Maps进阶系列二:使用GeocodeService进行地理位置检索 在<Bing Maps进阶系列一:初识Bing Maps地图服务>里已经对GeocodeService的功能 ...
- C# 数组转换为DataTable 的三个方法
C# 数组转换为DataTable 的三个方法 using System; using System.Data; namespace ArrayToDataTable { class ArrayT ...
- 修改select默认样式
http://www.qkzone.com/code/2015-11-26/1.html
- bzoj3105 [cqoi2013]新Nim游戏——贪心+线性基
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3105 首先,要先手必胜,就不能取后让剩下的火柴中存在异或和为0的子集,否则对方可以取成异或和 ...
- esp和ebp指针
gdb调试的时候会出现esp和ebp这两个指针,而这两个指针为我们查看栈的情况提供了方便. 简单点说,esp指向栈顶,而ebp指向栈底.例如一段程序: #include <stdio.h> ...
- [Apple开发者帐户帮助]六、配置应用服务(5.1)推送通知(APN):使用身份验证令牌与APN通信
您可以使用一个APN签名密钥为多个应用程序验证令牌.签名密钥适用于开发和生产环境.签名密钥不会过期,但可以撤消. 首先在Xcode项目中启用推送通知.接下来创建并下载启用了APN 的私钥. 然后获取密 ...