rss.m

来自「功能极全的GPS开发工具箱」· M 代码 · 共 26 行

M
26
字号
%                           rss.m
%  Scope:   This MATLAB macro computes root sum square (RSS) of a 
%           three component vector sample.
%  Usage:   y = rss(x)
%  Description of parameters:
%           x  -  input, sample vector, x(i,*) is an i-th three component 
%                 vector sample 
%           y  -  output, RSS value, y(i) is the RSS of the i-th three
%                 component vector sample
%  Last update:  04/19/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

function  y = rss(x)

[m,n] = size(x);
if n ~= 3
   error('Error - RSS; the sample does not have three component vectors');
end

if  m >= 1
   for i = 1:m
      y(i) = sqrt(x(i,1) * x(i,1) + x(i,2) * x(i,2) + x(i,3) * x(i,3));
   end
else
   error('Error - RSS; the sample has no meaningful dimension');
end

⌨️ 快捷键说明

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