Community Profile

photo

Ahmad Shalabi


The Hashemith University

53 total contributions since 2015

Contact

Ahmad Shalabi's Badges

  • Commenter
  • Promoter
  • Solver

View details...

Contributions in
View by

Solved


Beginner's Problem - Squaring
Try out this test problem first. Given the variable x as your input, square it by two and put the result in y. Examples: ...

plus de 4 ans ago

Solved


How many jokers?
* Given DNA codes of a group of suspects, * and a code for certain types of jokers, * Count how many jokers of that type. * ...

plus de 4 ans ago

Solved


Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0". Exa...

plus de 4 ans ago

Solved


What number has this problem?
This problem is added because it is problem number *???* in the "Community" problems section. <http://www.mathworks.de/matlab...

plus de 4 ans ago

Solved


Create matrix of replicated elements
Given an input element x, and the dimensions, (m, n) return a matrix of size m x n filled with element x. Example: Input: ...

plus de 4 ans ago

Solved


only input
Return the output without writing any code into the function.

plus de 4 ans ago

Solved


Create a square matrix of multiples
Given an input, N, output a matrix N x N with each row containing multiples of the first element of each row. This also applies...

plus de 4 ans ago

Solved


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

plus de 4 ans ago

Solved


Add 7
Given an input variable x, output a variable y that is 7 greater than x. Example: Input x = 1 Output y is 8 Input ...

plus de 4 ans ago

Solved


Y=X
Given an input variable x, output a variable y that is equal in value to x. Example: Input x = 1 Output y is 1 Inp...

plus de 4 ans ago

Solved


2倍してみよう - ここからスタート!
初めにこの問題を試してみよう。 入力としてxを与え、それを2倍して結果をyに代入せよ。 Examples: Input x = 2 Output y is 4 Input x = 17 Output y is 34 ...

plus de 4 ans ago

Solved


radius of a spherical planet
you just measured its surface area, that is the input.

plus de 4 ans ago

Solved


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

plus de 4 ans ago

Solved


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

plus de 4 ans ago

Solved


Distance walked 1D
Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

plus de 4 ans ago

Solved


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

plus de 4 ans ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

plus de 4 ans ago

Solved


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

plus de 4 ans ago

Solved


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

plus de 4 ans ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

plus de 4 ans ago

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

plus de 4 ans ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

plus de 4 ans ago

Solved


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

plus de 4 ans ago

Solved


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

plus de 4 ans ago

Solved


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

plus de 4 ans ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

plus de 4 ans ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

plus de 4 ans ago

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

plus de 4 ans ago

Solved


Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

plus de 4 ans ago

Solved


Unit Matrix
Given n, you should return an n-by-n unit matrix. Example: If input is n=2 then A = [ 1 0 0 1 ] If input ...

plus de 4 ans ago

Load more