📄 nano3write.m
字号:
function [count, errmsg]= nano3write(filename, header, img)%NANO3WRITE Write the header and the image to a nanoscope file.%% [COUNT, ERRMSG] = NANO3WRITE(FILENAME, HEADER, IMAGE)%% Return the number of elements successfully written.% and an error message if occour.%% Before to write the file, the image is -90 degree% rotated to be compatible with the nanoscope.%%% Claudio October 2, 1994.%% Copyright (c) 1995 by Claudio Rivetti and Mark Young% claudio@alice.uoregon.edu, mark@alice.uoregon.edu%fp = fopen(filename, 'w');if fp == -1 errmsg='Can not create file'; return;endimg=rot90(img, -1);count_header = fwrite(fp, header', 'char');count_img = fwrite(fp, img, 'short', 'vaxd');em=ferror(fp, 'clear');fclose(fp);count = prod(size(header)) + prod(size(img));if count ~= count_header + count_img errmsg=em;endreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -