Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x=[
11001000 ;
11001001 ;
11001010 ;
11001011 ;
11001100 ;
11001101 ;
11001110 ;
11001111 ;
11010000 ;
11010001 ;
11010010 ;
11010011 ;
11010100 ;
11010101 ;
11010110 ;
11010111 ;
11011000 ;
11011001 ;
11011010 ;
11011011 ;
11011100 ;
11011101 ;
11011110 ;
11011111 ;
11100000 ;
11100001 ;
11100010 ;
11100011 ;
11100100 ;
11100101 ;
11100110 ];
y_correct =[ 200 ; 201 ; 202 ; 203 ; 204 ; 205 ; 206 ; 207 ; 208 ; 209 ; 210 ; 211 ; 212 ; 213 ; 214 ; 215 ; 216 ; 217 ; 218 ; 219 ; 220 ; 221 ; 222 ; 223 ; 224 ; 225 ; 226 ; 227 ; 228 ; 229 ; 230];
assert(isequal(BinToDec(x),y_correct))
ans =
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
2 | Pass |
x= [
101000000;
101000001;
101000010;
101000011;
101000100;
101000101;
101000110;
101000111;
101001000;
101001001;
101001010;
101001011;
101001100;
101001101;
101001110;
101001111;
101010000;
101010001;
101010010;
101010011;
101010100 ];
y_correct =[ 320 ; 321 ; 322 ; 323 ; 324 ; 325 ; 326 ; 327 ; 328 ; 329 ; 330 ; 331 ; 332 ; 333 ; 334 ; 335 ; 336 ; 337 ; 338 ; 339 ; 340 ];
assert(isequal(BinToDec(x),y_correct))
ans =
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
|
Select every other element of a vector
20357 Solvers
2401 Solvers
Append two matrix as shown below example
182 Solvers
993 Solvers
556 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!