Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
nocheat = isempty(regexp(evalc('type subsdef'),'(eval|regexprep|inline|str2func)'));
y_correct = 1i;
b(12) = y_correct;
defstr = '(12)';
assert(isequal(subsref(b,subsdef(defstr)),y_correct) && nocheat)
|
2 | Pass |
%%
nocheat = isempty(regexp(evalc('type subsdef'),'(eval|regexprep|inline|str2func)'));
y_correct = -4i;
c{1,2,3,4,5}.field_b = y_correct;
defstr = '{1,2,3,4,5}.field_b';
assert(isequal(subsref(c,subsdef(defstr)),y_correct) && nocheat)
|
3 | Pass |
%%
nocheat = isempty(regexp(evalc('type subsdef'),'(eval|regexprep|inline|str2func)'));
y_correct = 3i;
a(12).field_b{1,3}{2}((3),1).c = y_correct;
defstr = '(12).field_b{1,3}{2}((3),1).c';
assert(isequal(subsref(a,subsdef(defstr)),y_correct) && nocheat)
|
4 | Pass |
%%
nocheat = isempty(regexp(evalc('type subsdef'),'(eval|regexprep|inline|str2func)'));
y_correct = repmat(2i,3,1);
d{2}.a(1:3,:) = y_correct;
defstr = '{2}.a(1:3,:)';
assert(isequal(subsref(d,subsdef(defstr)),y_correct) && nocheat)
|
Swap the first and last columns
12411 Solvers
Extract leading non-zero digit
1205 Solvers
Project Euler: Problem 10, Sum of Primes
707 Solvers
Remove the two elements next to NaN value
411 Solvers
108 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!