source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/yalmiptest.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 16.2 KB
Line 
1function out = yalmiptest(prefered_solver,auto)
2%YALMIPTEST Runs a number of test problems.
3%
4%   YALMIPTEST is recommended when a new solver or a new version
5%   of YALMIP installed.
6%
7%   EXAMPLES
8%    YALMIPTEST               % Without argument, default solver used
9%    YALMIPTEST('solver tag') % Test with specified solver
10%    YALMIPTEST(options)      % Test with specific options structure from
11%
12%   See also SDPSETTINGS, YALMIPDEMO
13
14% Author Johan Löfberg
15% $Id: yalmiptest.m,v 1.27 2006/05/16 14:44:27 joloef Exp $
16
17
18if ~exist('sedumi2pen.m')
19    disp('Add /yalmip/extras to your path first...')
20    return
21end
22
23if ~exist('bmibnb.m')
24    disp('Add /yalmip/modules/ with sub-directories to your path first...')
25    return
26end
27
28if ~exist('pwa_yalmip.m')
29    disp('Add /yalmip/operators to your path first...')
30    return
31end
32
33if ~exist('callsedumi.m')
34    disp('Add /yalmip/solvers to your path first...')
35    return
36end
37
38detected = which('yalmip.m','-all');
39if length(detected)>1
40    disp('You seem to have multiple installations of YALMIP in your path. Please correct this...');
41    detected
42    return
43end
44
45donttest = 0;
46if (nargin==1) & isa(prefered_solver,'char') & strcmp(prefered_solver,'test')
47    donttest = 0;
48    prefered_solver = '';   
49else
50    donttest = 1;
51end
52
53if nargin==0
54    prefered_solver = '';
55else
56    if ~(isa(prefered_solver,'struct') | isa(prefered_solver,'char'))
57        error('Argument should be a solver tag, or a sdpsettings structure');
58    end
59    if isa(prefered_solver,'char')
60        donttest = 1;
61    end
62end
63
64if ~(exist('callsedumi')==2)
65    disp('The directory yalmip/solvers is not in your path.')
66    disp('Put yalmip/, yalmip/solvers, yalmip/extras and yalmip/demos in your MATLAB path.');
67    return
68end
69
70foundstring = {'not found','found'};
71teststring = {'-failed','+passed'};
72if ~donttest
73    header = {'Solver','Version/module','Status','Unit test'};
74else
75    header = {'Solver','Version/module','Status'};
76end   
77
78[solvers,found] = getavailablesolvers(0);
79solvers = solvers([find(found);find(~found)]);
80found = [found(find(found));found(find(~found))];
81j = 1;
82for i = 1:length(solvers)
83    if solvers(i).show
84        data{j,1} = upper(solvers(i).tag);
85        data{j,2} = solvers(i).version;
86        data{j,3} = foundstring{found(i)+1};   
87        if ~donttest
88            if found(i)
89                if options.verbose
90                    disp(['Testing ' solvers(i).tag '...']);   
91                end
92                try
93                    if solvers(i).maxdet
94                        pass = lyapell(sdpsettings('solver',solvers(i).tag,'verbose',0));           
95                    else
96                        if solvers(i).sdp
97                            pass = stabtest(sdpsettings('solver',solvers(i).tag,'verbose',0));
98                        else
99                            pass = feasiblelp(sdpsettings('solver',solvers(i).tag,'verbose',0));
100                        end
101                    end
102                    data{j,4} = teststring{pass+1};
103                catch
104                    data{j,4} = '-failed';
105                end
106            else
107                data{j,4} = 'not tested';
108            end
109        end
110        j = j+1;
111    end
112end
113
114if isa(prefered_solver,'char')
115    ops = sdpsettings('Solver',prefered_solver);
116else
117    ops = prefered_solver;
118end
119
120if ~((nargin==2) & (ops.verbose==0))   
121table({'Searching for installed solvers'},header,data);
122disp(' ')
123end
124if nargin<2
125    disp('Press any key to continue test')
126    pause
127end
128
129i=1;
130test{i}.fcn  = 'testsdpvar';
131test{i}.desc = 'sdpvar/set methods';
132i = i+1;
133
134test{i}.fcn  = 'feasiblelp';
135test{i}.desc = 'LP';
136i = i+1;
137
138test{i}.fcn  = 'toepapprox';
139test{i}.desc = 'LP';
140i = i+1;
141
142test{i}.fcn  = 'feasibleqp';
143test{i}.desc = 'QP';
144i = i+1;
145
146test{i}.fcn  = 'toepapprox2';
147test{i}.desc = 'QP';
148i = i+1;
149
150
151test{i}.fcn  = 'socptest1';
152test{i}.desc = 'SOCP';
153i = i+1;
154
155test{i}.fcn  = 'socptest2';
156test{i}.desc = 'SOCP';
157i = i+1;
158
159test{i}.fcn  = 'socptest3';
160test{i}.desc = 'SOCP';   
161i = i+1;
162
163test{i}.fcn  = 'complete';
164test{i}.desc = 'SDP';
165i = i+1;
166
167test{i}.fcn  = 'complete_2';
168test{i}.desc = 'SDP';
169i = i+1;
170
171test{i}.fcn  = 'maxcut';
172test{i}.desc = 'SDP';
173i = i+1;
174
175test{i}.fcn  = 'feasible';
176test{i}.desc = 'SDP';
177i = i+1;
178
179test{i}.fcn  = 'lyapell';
180test{i}.desc = 'MAXDET';
181i = i+1;
182
183test{i}.fcn  = 'lyapell2';
184test{i}.desc = 'MAXDET';
185i = i+1;
186
187%test{i}.fcn  = 'circuit1';
188%test{i}.desc = 'GP';
189%i = i+1;
190
191test{i}.fcn  = 'infeasible';
192test{i}.desc = 'Infeasible LP';
193i = i+1;
194
195test{i}.fcn  = 'infeasibleqp';
196test{i}.desc = 'Infeasible QP';
197i = i+1;
198
199test{i}.fcn  = 'infeasiblesdp';
200test{i}.desc = 'Infeasible SDP';
201i = i+1;
202
203test{i}.fcn  = 'momenttest';
204test{i}.desc = 'Moment relaxation';
205i = i+1;
206
207test{i}.fcn  = 'sostest';
208test{i}.desc = 'Sum-of-squares';
209i = i+1;
210
211test{i}.fcn  = 'bmitest';
212test{i}.desc = 'Bilinear SDP';
213i = i+1;
214
215
216
217pass_strings = {'Error','Passed','Solver not available'};
218
219tt = cputime;
220
221% Run test-problems
222for i = 1:length(test)
223    try
224        t=cputime;           
225        if ops.verbose
226            disp(' ');
227            disp(['Testing function ' test{i}.fcn]);
228            disp(' ');
229        end       
230        [pp,ss,res] = eval([test{i}.fcn '(ops)']);
231        pass(i) = pp;
232        sols{i} = ss.info;
233        results{i}=res;
234        ttime(i) = cputime-t;
235    catch
236        pass(i) = 0;   
237        results{i} = 'NAN';
238        sols{i} = 'Unknown problem in YALMIP';
239        ttime(i) = cputime-tt;
240    end
241end
242totaltime = cputime-tt;
243
244clear data;
245header = {'Test','Solution', 'Solver message'};
246for i = 1:length(pass)
247    thetime =  num2str(ttime(i),4);
248    data{i,1} = test{i}.desc;
249    data{i,2} = results{i};
250    data{i,3} = sols{i};
251end
252if ops.verbose
253    disp(' ');
254end
255formats{1}.data.just = 'right';
256formats{2}.data.just = 'right';
257formats{3}.data.just = 'right';
258
259formats{1}.header.just = 'right';
260formats{2}.header.just = 'right';
261formats{3}.header.just = 'right';
262
263clc
264table([],header,data,formats)
265
266
267function [pass,sol,result] = testsdpvar(ops)
268
269% Test the sdpvar implementation
270pass = 1;
271sol.info = yalmiperror(0,'YALMIP');
272try
273    x = sdpvar(2,2);
274    x = sdpvar(2,2,'symmetric');
275    x = sdpvar(2,2,'full');
276    x = sdpvar(2,2,'toeplitz');
277    x = sdpvar(2,2,'hankel');
278    x = sdpvar(2,2,'skew');
279    if ~ishermitian(sdpvar(2,2,'hermitian','complex'))
280        error('bug')
281    end
282    if ~issymmetric(sdpvar(2,2,'symmetric','complex'))
283        error('bug')
284    end
285    if ~isreal(real(sdpvar(2,2,'symmetric','complex')))
286        error('bug')
287    end
288    if isreal(sqrt(-1)*real(sdpvar(2,2,'symmetric','complex')))
289        error('bug')
290    end
291    x = sdpvar(2,1,'','co');
292    if ~isreal(x'*x)
293        error('bug')
294    end
295    x = sdpvar(2,2,'','co');
296    if ~isreal(diag(x'*x))
297        error('bug')
298    end
299    x = sdpvar(1,1);
300    y = sdpvar(2,2);
301    x*eye(2);
302    eye(2)*x;
303    y*3;
304    3*y;
305    x = sdpvar(2,3);
306    y = sdpvar(2,3);
307    setsdpvar(x,randn(2,3));
308    z = replace(x,x(1,1:2),[8 9]);
309    z = x+y;
310    z = x-y;
311    z = x+1;
312    z = x-1;
313    z = x+ones(2,3);
314    z = x-ones(2,3);
315    z = ones(2,3)-x;
316    z = ones(2,3)-x;
317    z = eye(2)*x;
318    z = x*eye(3);
319    z = diag(x);
320    z = trace(x);
321    z = diff(x);
322    z = fliplr(x);
323    z = flipud(x);
324    z = kron(x,eye(3));
325    z = kron(eye(3),x);
326    z = rot90(x);
327    z = sum(x);
328    z = diff(x);
329    z = x';
330    z = x.';
331    z = tril(x);
332    z = triu(x);
333    z = [x y];
334    z = [x;y];
335    sdpvar x y
336    diag([x y])*[x^-1;y^-1];
337    assert(isequal([x x;x x]*x,[x x;x x].*x))
338    assert(isequal(trace([x x;x x]*[x y;y x]),x*x+x*y+y*x+x*x))
339   
340    % Regression ??
341    yalmip('clear')
342    sdpvar x
343
344    (1+x+x^4)*(1-x^2);
345   
346    % Regression complex multiplcation
347    A = randn(10,5)+sqrt(-1)*randn(10,5);
348    b = randn(10,1)+sqrt(-1)*randn(10,1);
349    x = sdpvar(5,1);
350    res = A*x-b;
351    assert(nnz(clean([res res]'*[res res]-res'*res,1e-8))==0)
352    assert(isreal(clean(res'*res,1e-8)))
353   
354    sdpvar x(1,1,'full','complex');
355    assert(isreal(x*x'))
356   
357%     x = sdpvar(4,1);
358%     sdpvar i a   
359%     y = [i a];
360%     y(1)
361%    % i = sdpvar(1,1);
362%    % a = sdpvar(1,1);
363%    % [i a]
364%     
365%     
366%     
367%     size(x([i j]))
368%     assert(all(size(x([i j])) == [2 1]))
369%     assert(all(size(x(1,[i j])) == [1 2]))
370%    % assert(all(size(x(1,[i j])) == [1 2]));
371%    % x(1,[i j]);
372   % x([i j],1);
373   % x([i j],[i j]);
374   
375   
376   
377    result = 'N/A';
378catch
379    sol.info = 'Problems';
380    result = 'N/A';
381    pass = 0;
382end
383
384
385function [pass,sol,result] = feasible(ops)
386t = sdpvar(1,1);
387Y = sdpvar(2,2);
388F = set('Y<t*eye(2)');
389F = F+set('Y>[1 0.2;0.2 1]');
390sol = solvesdp(F,t,ops);
391pass = ismember(sol.problem,[0 3 4 5]);
392if pass
393    result = resultstring(t,1.2);
394else
395    result = 'N/A';
396end
397   
398
399
400function [pass,sol,result] = infeasible(ops)
401t = sdpvar(1,1);
402Y = sdpvar(2,2);
403F = set('t>0');
404F = F+set('t<-10');
405sol = solvesdp(F,t,ops);
406pass = ~(sol.problem==0);
407result = 'N/A';
408
409function [pass,sol,result] = lyapell(ops)
410A = [1 0;0.4 1];
411B = [0.4;0.08];
412L = [1.9034 1.1501];
413
414Y = sdpvar(2,2);
415F = set([Y Y*(A-B*L)';(A-B*L)*Y Y]);
416F = F+set('L*Y*L''<1');
417sol = solvesdp(F,-logdet(Y),ops);
418Y = double(Y);
419pass = ismember(sol.problem,[0 3 4 5]);
420if pass
421    result = resultstring(Y,[2.9957 -4.1514;-4.1514 6.2918]);
422else
423    result = 'N/A';
424end
425%pass = pass & (sum(sum(abs(Y-[2.9957 -4.15;-4.15 6.29])))<0.01);
426
427function [pass,sol,result] = lyapell2(ops)
428A = [1 0;0.4 1];
429B = [0.4;0.08];
430L = [1.9034 1.1501]; 
431Y = sdpvar(2,2);
432F = set('[Y Y*(A-B*L)'';(A-B*L)*Y Y]>0');
433F = F+set('L*Y*L''<1');
434sol = solvesdp(F,-logdet(Y),ops);
435Y = double(Y);
436pass = ismember(sol.problem,[0 3 4 5]);
437if pass
438    result = resultstring(Y,[2.9957 -4.1514;-4.1514 6.2918]);
439else
440    result = 'N/A';
441end
442
443function [pass,sol,result] = complete(ops)
444x = sdpvar(1,1);
445y = sdpvar(1,1);
446z = sdpvar(1,1);
447
448X = [x 1 2;1 y 3;2 3 100];
449
450F = set(X>0);
451F = F+set(x>10);
452F = F+set(y>0);
453F = F+set(z>0);
454F = F+set(x<1000);
455F = F+set(y<1000);
456F = F+set(z<1000);
457sol = solvesdp(F,x+y+z,ops);
458x   = double(x);
459y   = double(y);
460z   = double(z);
461
462pass = ismember(sol.problem,[0 3 4 5]);
463result = 'N/A';
464if pass
465    result = resultstring([x;y;z],[10;0.1787;0]);
466else
467    result = 'N/A';
468end
469
470
471function [pass,sol,result] = complete_2(ops)
472x = sdpvar(1,1);
473%y = sdpvar(1,1);
474z = sdpvar(1,1);
475
476X = [x 2;2 z];
477
478F = set('X>0');
479F = F+set('x>0');
480F = F+set('z>0');
481F = F+set('x<10');
482F = F+set('z<10');
483sol = solvesdp(F,x+z,ops);
484x   = double(x);
485%y   = double(y);
486z   = double(z);
487
488pass = ismember(sol.problem,[0 3 4 5]);
489result = 'N/A';
490if pass
491    result = resultstring([x;z],[2;2]);
492else
493    result = 'N/A';
494end
495
496
497
498function [pass,sol,result]  = maxcut(ops)
499% Upper bound on maxcut of a n-cycle
500n = 15;
501Q = zeros(n);
502for i = 1:n-1
503    Q(i,i+1) = 1;Q(i+1,i)  = 1;
504end
505Q(n,1) = 1;Q(1,n) = 1; 
506Q = 0.25*(diag(Q*ones(n,1))-Q);
507
508t = sdpvar(1,1);
509tau = sdpvar(n,1);
510
511F = set('t>0');
512
513M = [-Q zeros(n,1);zeros(1,n) t];
514
515for i = 1:n
516    ei = zeros(n,1);ei(i,1) = 1;
517    M = M+tau(i)*[ei*ei' zeros(n,1);zeros(1,n) -1];
518end
519
520F = F+set(M>0);
521sol = solvesdp(F,t,ops);
522
523t   = double(t);
524tau = double(t);
525
526pass = ismember(sol.problem,[0 3 4 5]);
527if pass
528    result = resultstring(t,14.8361);
529else
530    result = 'N/A';
531end
532
533
534function [pass,sol,result] = socptest1(ops)
535x = sdpvar(2,1);
536a = [0;1];
537b = [1;1];
538F = set('||x-a||<1');
539F = F+set('||x-b||<1');
540sol = solvesdp(F,sum(x),ops);
541pass = ismember(sol.problem,[0 3 4 5]);
542
543x = double(x);
544
545if pass
546    result = resultstring(sum(x),0.58578);
547else
548    result = 'N/A';
549end
550
551
552
553function [pass,sol,result] = socptest2(ops)
554z = sdpvar(3,1);
555x = sdpvar(3,1);
556y = sdpvar(3,1);
557a = [0;1;0];
558b = [1;1;0];
559F = set('||x-a||<1');
560F = F+set('||x-b||<1');
561F = F+set('x(1)==0.35');
562F = F+set('z(2:3)==[5;6]');
563sol = solvesdp(F,sum(x),ops);
564pass = ismember(sol.problem,[0 3 4 5]);
565
566x = double(x);
567y = double(y);
568z = double(z);
569
570if pass
571    result = resultstring(sum(x),0.27592);
572else
573    result = 'N/A';
574end
575
576
577
578function [pass,sol,result] = socptest3(ops)
579z = sdpvar(2,1);
580x = sdpvar(2,1);
581y = sdpvar(3,1);
582a = [0;1];
583b = [1;1];
584F = set('||x-a||<1');
585F = F+set('||x-b||<1');
586F = F+set('x(1)==0.35');
587F = F+set('z(1,end)>5');
588F = F+set('z(2,end)<100');
589F = F+set('z(2)==5');
590
591sol = solvesdp(F,sum(x),ops);
592pass = ismember(sol.problem,[0 3 4 5]);
593
594x = double(x);
595y = double(y);
596z = double(z);
597if pass
598    result = resultstring(sum(x),0.59);
599else
600    result = 'N/A';
601end
602
603
604
605function [pass,sol,result] = feasiblelp(ops)
606N = 5;
607A = [2 -1;1 0];
608B = [1;0];
609C = [0.5 0.5];
610[H,S] = create_CHS(A,B,C,N);
611x = [2;0];
612t = sdpvar(2*N,1);
613U = sdpvar(N,1);   
614Y = H*x+S*U;
615F = set(U<1)+set(U>-1);
616F = F+set(Y(N)>-1); 
617F = F+set(Y(N)<1);
618F = F+set([Y;U]<t)+set([Y;U]>-t);
619sol = solvesdp(F,sum(t),ops);
620pass = ismember(sol.problem,[0 3 4 5]);
621if pass
622    result = resultstring(sum(t),12.66666);
623else
624    result = 'N/A';
625end
626
627function [pass,sol,result] = feasibleqp(ops)
628N = 5;
629A = [2 -1;1 0];
630B = [1;0];
631C = [0.5 0.5];
632[H,S] = create_CHS(A,B,C,N);
633x = [2;0];
634U = sdpvar(N,1);   
635Y = H*x+S*U;
636F = set(U<1)+set(U>-1);
637F = F+set(Y(N)>-1); 
638F = F+set(Y(N)<1);
639sol = solvesdp(F,Y'*Y+U'*U,ops);
640pass = ismember(sol.problem,[0 3 4 5]);
641if pass
642    result = resultstring(Y'*Y+U'*U,26.35248);
643else
644    result = 'N/A';
645end
646
647
648function [pass,sol,result] = infeasibleqp(ops)
649N = 5;
650A = [2 -1;1 0];
651B = [1;0];
652C = [0.5 0.5];
653[H,S] = create_CHS(A,B,C,N);
654x = [2;0];
655U = sdpvar(N,1);   
656Y = H*x+S*U;
657F = set(U<1)+set(U>-1);
658F = F+set(Y(N)>-1); 
659F = F+set(Y(N)<1);
660F = F + set(U>0);
661sol = solvesdp(F,Y'*Y+U'*U,ops);
662pass = ismember(sol.problem,[1]);
663result = 'N/A';
664
665
666
667function [pass,sol,result] = infeasiblesdp(ops)
668A = magic(6);
669A = A*A';
670P = sdpvar(6,6);
671sol = solvesdp(set(A'*P+P*A < -P) + set(P>eye(6)),trace(P),ops);
672pass = (sol.problem==1);
673result = 'N/A';
674
675function [pass,sol,result]=toepapprox(ops)
676
677n = 5;
678P = magic(n);
679Z = sdpvar(n,n,'toeplitz');
680t = sdpvar(n,n,'full');
681F = set(P-Z<t)+set(P-Z>-t);
682sol = solvesdp(F,sum(sum(t)),ops);
683pass = ismember(sol.problem,[0 3 4 5]);
684result = 'N/A';
685if pass
686    result = resultstring(sum(sum(t)),156);
687else
688    result = 'N/A';
689end
690
691
692function [pass,sol,result]=toepapprox2(ops)
693
694n = 5;
695P = magic(n);
696Z = sdpvar(n,n,'toeplitz');
697t = sdpvar(n,n,'full');
698resid = P-Z;resid = resid(:);
699sol = solvesdp([],resid'*resid,ops);
700pass = ismember(sol.problem,[0 3 4 5]);
701result = 'N/A';
702if pass
703    result = resultstring(resid'*resid,1300);
704else
705    result = 'N/A';
706end
707
708function [pass,sol,result]=momenttest(ops)
709
710x1 = sdpvar(1,1);
711x2 = sdpvar(1,1);
712x3 = sdpvar(1,1);
713
714objective = -2*x1+x2-x3;
715
716F = set(x1*(4*x1-4*x2+4*x3-20)+x2*(2*x2-2*x3+9)+x3*(2*x3-13)+24>0);
717F = F + set(4-(x1+x2+x3)>0);
718F = F + set(6-(3*x2+x3)>0);
719F = F + set(x1>0);
720F = F + set(2-x1>0);
721F = F + set(x2>0);
722F = F + set(x3>0);
723F = F + set(3-x3>0);
724sol = solvemoment(F,objective,ops);
725pass = ismember(sol.problem,[0 3 4 5]);
726result = 'N/A';
727if pass
728    result = resultstring(objective,-6);
729else
730    result = 'N/A';
731end
732
733function [pass,sol,result]=sostest(ops)
734
735yalmip('clear')
736x = sdpvar(1,1);
737y = sdpvar(1,1);
738t = sdpvar(1,1);
739F = set(sos(1+x^7+x^8+y^4-t));
740sol = solvesos(F,-t,ops);
741pass = ismember(sol.problem,[0 3 4 5]);
742result = 'N/A';
743if pass
744    result = resultstring(t,0.9509);
745else
746    result = 'N/A';
747end
748
749function [pass,sol,result]=bmitest(ops)
750
751A = [-1 2;-3 -4];
752P = sdpvar(2,2);
753alpha = sdpvar(1,1);
754F = set(P>eye(2))+set(A'*P+P*A < -2*alpha*P)+set(alpha > 0);
755sol = solvesdp(F,-alpha,ops);
756pass = ismember(sol.problem,[0 3 4 5]);
757result = 'N/A';
758if pass
759    result = resultstring(alpha,2.5);
760else
761    result = 'N/A';
762end
763
764
765function [pass,sol,result]=circuit1(ops)
766x = sdpvar(7,1);
767
768% Data
769a     = ones(7,1);
770alpha = ones(7,1);
771beta  = ones(7,1);
772gamma = ones(7,1);
773f = [1 0.8 1 0.7 0.7 0.5 0.5]';
774e = [1 2 1 1.5 1.5 1 2]';
775Cout6 = 10;
776Cout7 = 10;
777
778% Model
779C = alpha+beta.*x;
780A = sum(a.*x);
781P = sum(f.*e.*x);
782R = gamma./x;
783
784D1 = R(1)*(C(4));
785D2 = R(2)*(C(4)+C(5));
786D3 = R(3)*(C(5)+C(7));
787D4 = R(4)*(C(6)+C(7));
788D5 = R(5)*(C(7));
789D6 = R(6)*Cout6;
790D7 = R(7)*Cout7;
791
792% Constraints
793F = set(x > 1) + set(P < 20) + set(A < 100);
794
795% Objective
796D = max((D1+D4+D6),(D1+D4+D7),(D2+D4+D6),(D2+D4+D7),(D2+D5+D7),(D3+D5+D6),(D3+D7));
797
798sol = solvesdp(F,D,ops);
799
800pass = ismember(sol.problem,[0 3 4 5]);
801result = 'N/A';
802if pass
803    result = resultstring(D,7.8936);
804else
805    result = 'N/A';
806end
807
808
809
810
811
812function result = resultstring(x,xopt)
813if norm(double(x(:))-xopt(:))<1e-3*(1+norm(xopt(:)))
814    result = 'Correct';
815else
816    result = 'Incorrect';
817end
818
819function assert(a)
820if ~a
821    error('Assertion failed!');
822end
823
Note: See TracBrowser for help on using the repository browser.