MATLAB supports object-oriented programming. Let's take an advantage of it in cody.
This problem focus on modifying subscripted references for class double.
This example shows classical behavior:
>> A = [1 4 7 2 5 8 3 6 9]; >> A([1 3], [3 1])
ans =
7 1 9 3
While this is what I am looking for:
>> modified_A = sub_double(A); >> modified_A([1 3], [3 1])
ans =
7 3
>> modified_A([1 2 2], [3 1 2])
ans =
7 2 5
If there are given two subscripts vectors of the same lenght, return only those values which correspond to paired subscriptions.
Task: You are given class template. Complete it to achieve desired behaviour.
Additional info:
>> doc 'Class Definition' >> doc 'Customize MATLAB Behavior'
Enjoy!
Are they still allowing classes? My solution passed all the tests on my computer.
However, when I ran it on Cody, I got "Something went wrong. Please check your code for errors and try again later."
Hi Andrew, I will check it out.
Whatever the problem is, it went away.
Remove all the words that end with "ain"
1026 Solvers
Extract leading non-zero digit
967 Solvers
522 Solvers
Renaming a field in a structure array
542 Solvers
Avalaible area: wall construction
47 Solvers