file operation
来源:互联网 发布:淘宝lol半价点券来源 编辑:程序博客网 时间:2024/04/27 04:36
clear all;
clc;
num_pts = 10;
Afull = zeros(num_pts,num_pts);
Afull(1,1) = 1;
Afull(num_pts,num_pts) = 1;
for i = 2:(num_pts-1) %sum over interior points
Afull(i,i) = 2;
Afull(i,i-1) = -1;
Afull(i,i+1) = -1;
end
b = linspace(0,1,num_pts)';
x = Afull/b;
whos;
% Visualize sparsity pattern
spy(Afull);
sparse(Afull)
% save mem_store1.mat;
% pause;
% clear all;
% whos;
% ls *.mat
% pause;
% load mem_store1.mat;
% whos;
% pause;
% delete mem_store1.mat
% ls *.mat
%
% pwd
% cd ..
% pwd
% ls
% save store1.dat Afull -ascii;
% type store1.dat
% % load store1.dat
%
% delete store1.dat;
% save store1.dat Afull -ascii -double;
% type store1.dat
%file operation write b(i) into test_io.dat
FID_out = fopen('test_io.dat','w');
ls
for i = 1:length(b)
fprintf(FID_out,'%10.6f /n',b(i));
end
fclose(FID_out);
disp('Contents of test_io.dat:');
type test_io.dat;
% read the file into b_new
FID_in = fopen('test_io.dat');
b_new = linspace(0,0,num_pts)';
for i = 1:num_pts
b_new(i) = fscanf(FID_in,'%f',1);
end
b_new;
% read file to x_new
FID_in = fopen('test_io.dat');
x_new = linspace(0,0,num_pts)';
x_new = fscanf(FID_in,'%f',num_pts);
x_new;
- file operation
- File Operation
- file operation
- Java text file operation
- C++ file IO operation
- api file operation
- C++ File Operation
- python file operation
- c++ MFC file operation
- c++ file operation
- c file operation
- windows file operation
- Tcl/Tk -- File Operation
- java file operation
- wxWidgets文件操作-file operation
- Base operation about XMl file
- file operation file inode的概念
- FSD Direct IO File Operation Library Source
- D3D键盘输入处理
- 正则表达式regular expression详述(一)
- win7刷bois破解经历,华硕主板.
- 把一张图片裁切为rows行,cols列
- asp.net 生成html
- file operation
- 运行命令
- DLL 导入的两种方式
- struts2 Action中获取request, response对象的 几种 方法
- mysql日期和时间格式转换
- 几个函数的问题 的深究fgets
- 学习Mercurial
- Java线程之Guarded Suspension Pattern和Balking Pattern
- c++的POD类型详解