Revision 168
(checked in by cbc, 16 years ago)
|
Adding diwasp customizations.
|
Line | |
---|
1 |
function writespec(SM,filename) |
---|
2 |
|
---|
3 |
%DIWASP V1.1 function |
---|
4 |
%writespec: writes spectrum matrix to file using DIWASP format |
---|
5 |
% |
---|
6 |
%writespec(SM,filename) |
---|
7 |
% |
---|
8 |
%Inputs: |
---|
9 |
%SM A spectral matrix structure |
---|
10 |
%filename String containing the filename including file extension if required |
---|
11 |
% |
---|
12 |
%All inputs required |
---|
13 |
% |
---|
14 |
%"help data_structures" for information on the DIWASP data structures |
---|
15 |
|
---|
16 |
%Copyright (C) 2002 Coastal Oceanography Group, CWR, UWA, Perth |
---|
17 |
|
---|
18 |
|
---|
19 |
SM=check_data(SM,2);if isempty(SM) return;end; |
---|
20 |
|
---|
21 |
nf=max(size(SM.freqs));nd=max(size(SM.dirs)); |
---|
22 |
|
---|
23 |
streamout(1)=SM.xaxisdir; |
---|
24 |
streamout(2)=nf; |
---|
25 |
streamout(3)=nd; |
---|
26 |
streamout(4:nf+3)=SM.freqs; |
---|
27 |
streamout(nf+4:nf+nd+3)=SM.dirs; |
---|
28 |
streamout(nf+nd+4)=999; |
---|
29 |
streamout(nf+nd+5:nf+nd+4+(nf*nd))=reshape(real(SM.S'),nf*nd,1); |
---|
30 |
|
---|
31 |
streamout=streamout'; |
---|
32 |
|
---|
33 |
eval(['save ',filename,' streamout -ASCII']); |
---|
34 |
|
---|
35 |
|
---|