Commit 57815173 authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

typo in quantity.Discrete/mpower,

it was not covered by a unittest, so I added one
parent d380681a
......@@ -1609,7 +1609,7 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete ...
function P = mpower(a, p)
% Matrix power a^p is matrix or scalar a to the power p.
if p == 0
P = setName(eye(size(a) + 0*a), "I");
P = setName(eye(size(a)) + 0*a, "I");
elseif p < 0
if numel(a) > 1
warning("mpower(a, p) implements a^p. " ...
......
......@@ -1219,7 +1219,7 @@ end
function testMPower(testCase)
%%
z = linspace(0,1).';
z = linspace(0,1,7).';
a = sin(z * pi);
A = quantity.Discrete({a}, 'grid', {z}, 'gridName', 'z');
......@@ -1227,8 +1227,8 @@ A = quantity.Discrete({a}, 'grid', {z}, 'gridName', 'z');
aa = sin(z * pi) .* sin(z * pi);
AA = A^2;
verifyTrue(testCase, numeric.near(aa, AA.on()));
testCase.verifyEqual( aa, AA.on())
testCase.verifyEqual( on(A^0), ones(size(z)))
end
......
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