~/matlab
when you invoke matlab automatically.alias mat 'nice matlab'
% nice matlab < foo.m > result.txtMore info in Mathworks.
ss1='str1';
ss2='str2';
ss3=[ss1 ss2]
smat=[{ss1}, {ss2}, {ss3}]
%
clear
%string test
ss1='str1';
ss2='str2';
ss3=[ss1 ss2]
smat=[{ss1}, {ss2}, {ss3}]
for m=1:3
ff1=sprintf('str_test%d',m);
fid=fopen(ff1,'w');
fprintf(fid,'This file is for %s\n',smat{m});
fclose(fid);
end
[NUM, DEN]=tfdata(H);
HB=NUM{1}; HA=DEN{1};
[HB, HA]=tfdata(H, 'v');
celar all
R = input('What is the data file name? : ', 's')
dd = load (R);
% you need '(' and ')'. That's a tip!
in1 = dd(:,1);
...
fft
.
Sample code to get the correct power:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% initialization
N = 1024; % Total number of samples
As = 1; % Signal amplitude
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Sine signal
st = As * sin(2*pi*100*[0:N-1]./N);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fft
Sf = fft(st);
Sf = Sf .* conj(Sf);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Normalization
% * 2 is for imaginary and real freq.
% N^2 to get -3dB for the amplitude of one
Sf = Sf * 2 / N^2;
plot(10*log10(Sf)); grid
xlabel({'frequency in Hz';'(a)'})
title('This is Kajita{\prime}s plot')
Here is what I am trying so far:
Last modified: Thu Oct 19 11:48:11 2000