Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
oltre 6 anni fa
Risolto
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
oltre 6 anni fa
Risolto
cross in array
Make a cross from "1" in odd size array. Other value from array should be equal to "0";
As input you get length of side of arra...
Calories in a slice of pizza?
The total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Ple...
oltre 6 anni fa
Risolto
sum all digits
input = 123456789, output = 1+2+3+4+5+6+7+8+9 = 45
oltre 6 anni fa
Risolto
concatenate the elements
you should concatenate the elements of a matrix in one dimensional array, for example if the input is
A = [1 2 3; 4 5 6; 7 ...