loadfilevariablesintows.m

来自「This are files abouth gps simulation too」· M 代码 · 共 19 行

M
19
字号
function [] = loadFileVariablesIntoWS(filename)
    
    % Check if file extension is given, if nt assume ".m"
    if strcmp(filename(end-1), '.') == 0
        filename = [ filename '.m' ];
    end

    fid = fopen(filename);
    if fid == -1
        error(sprintf('ERROR: Cannot find file specified: %s', filename));
    end

    % reads & evaluates the input lines in the file
    while ~feof(fid)
        current_line = fgetl(fid);
        if ~isempty(current_line) & current_line(1) ~= '%'
            evalin('caller',current_line);
        end
    end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?