LOADDATA Loads a matrix from a text file. CALL: data=loaddata(filename) data = the output data matrix. filename = a string containing the file to read. This routine is used to allow m-functions to load data files with their own name. ("fun.m" can't use "load fun.dat;v=fun;", but can use "v=loaddata('fun.dat');") Example:% x=loaddata('sea.dat'); size(x)
Find one string within another. |
Evaluates survival function R(h1,h2)=P(Ac>h1,At>h2). | |
Evaluates cdf of crests P(Ac<=h) or troughs P(At<=h). | |
Evaluates densities of wave period Tcc, wave lenght Lcc. | |
Evaluates densities for crest-,trough-period, length. | |
Calculates joint density of minimum and following maximum |
001 function data=loaddata(filename) 002 % LOADDATA Loads a matrix from a text file. 003 % 004 % CALL: data=loaddata(filename) 005 % 006 % data = the output data matrix. 007 % filename = a string containing the file to read. 008 % 009 % This routine is used to allow m-functions to load data files 010 % with their own name. ("fun.m" can't use "load fun.dat;v=fun;", but 011 % can use "v=loaddata('fun.dat');") 012 % Example:% 013 % 014 % x=loaddata('sea.dat'); size(x) 015 016 varname=filename; 017 i=findstr(varname,'.'); 018 if ~isempty(i) 019 varname=varname(1:max(i)-1); 020 end 021 i=findstr(varname,'\'); % PC systems 022 if ~isempty(i) 023 varname=varname(max(i)+1:length(varname)); 024 end 025 i=findstr(varname,'/'); % Unix systems 026 if ~isempty(i) 027 varname=varname(max(i)+1:length(varname)); 028 end 029 030 load(filename,'-ascii'); 031 eval(['data=' varname ';']); 032 eval(['clear ' varname]); 033
Comments or corrections to the WAFO group