作业帮 > 综合 > 作业

matlab中imf=[

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/03 18:55:24
matlab中imf=[
matlab中imf=[
就是将矩阵 imf 置成空.
你到matlab里试下.

>> imf = [0 1 2 3]
imf =
0 1 2 3
>> imf = []
imf =
[]
再问: 那x(:)表示什么意思啊
再答: 要取矩阵的多个数时候,:表示某一行或某一列的所有数。或者你可限定范围如x(1:6,2)表示取x的1到6行第二列的数据。 :还有好些用处,给你举几个例子吧。你也可以查看matlab的help文档。这个比较有帮助的。 如 >> x = 1:2:10 x = 1 3 5 7 9 >> a =magic(3) a = 8 1 6 3 5 7 4 9 2 >> a(:,1) ans = 8 3 4 >> a(1,:) ans = 8 1 6 >> a(1:2,1) ans = 8 3
再问: u2 = length(findpeaks(x))+length(findpeaks(-x))这条语句是什么意思 啊
再答: %FINDPEAKS Find up to npeaks interpolated peaks in data. % % [peakamps,peaklocs,peakwidths,resid] = % findpeaks(data,npeaks,minwidth,maxwidth,minpeak,debug); % % finds up to npeaks interpolated peaks in real data. % A peak is rejected if its width is % less than minwidth samples wide(default=1), or % less than minpeak in magnitude (default=min(data)). % Quadratic interpolation is used for peak interpolation. % Left-over data with peaks removed is returned in resid. % Peaks are returned in order of decreasing amplitude. % They can be sorted in order of location as follows: % [peaklocs,sorter] = sort(peaklocs); % amps = zeros(size(peakamps)); % npeaks = length(peaklocs); % for col=1:npeaks, % amps(:,col) = peakamps(:,sorter(col)); % end; % They can be sorted in order of width as follows: % [peakwidths,sorter] = sort(peakwidths); % peakamps = peakamps(sorter); % peaklocs = peaklocs(sorter); Matlab信号处理工具箱中的findpeaks可以返回一段信号中的局部最大(小)值以及其index。 你这个语句讲的是找出x这个向量中最大值与最小值的个数。length()这个函数是指向量的长度。可以参考下http://hi.baidu.com/gogll2/blog/item/ca5684e8643d7c24b80e2dfb.html