Commit 1ea0d1a2 authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

added elementwise power function to quantity.Discrete and on function to signals.SignalModel

parent 6fb4ed93
......@@ -1524,7 +1524,13 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete ...
error('sqrtm() is only implemented for quadratic matrices');
end
end % sqrtm()
function P = power(obj, p)
% #todo unittest required
P = quantity.Discrete.zeros(size(obj), obj(1).domain);
for k = 1:numel(obj)
P(k) = obj(k)^p;
end
end
function P = mpower(a, p)
% a^p implemented by multiplication
assert(p==floor(p) && p > 0);
......
......@@ -77,6 +77,16 @@ classdef SignalModel
end
methods ( Access = public )
function s = on(obj, time)
arguments
obj
time quantity.Domain = obj.time;
end
r = obj.simulate('time', time);
s = r.on();
end
function [r, v] = simulate(obj, optArg)
% SIMULATE a signal model
% [r, v] = simulate(obj, varargin) will simulate a signal model
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment