Community Profile

Jamal Nasir

Almustansiryah unversity

337 total contributions since 2018

Computer Sciences Department

View details...

Contributions in
View by

Solved

Convert yards to feet
The goal of this script is to convert a value given in yards to feet.

9 maanden ago

Solved

Temperature conversion
Convert temperature in degrees Celsius (C) to temperature in degrees Kelvin (K). Assume your answer is rounded to the nearest Ke...

9 maanden ago

Solved

Number of digits in an integer
Specifies how many digits in a given integer. Example: in=100 ==> out=3

9 maanden ago

Solved

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:...

9 maanden ago

Solved

03 - Matrix Variables 4
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3d.png>> A 3x4 NaN (Not a Number) matrix (Hint: use ...

10 maanden 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...

ongeveer een jaar ago

Solved

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...

ongeveer een jaar ago

Solved

Arrange vector in ascending order
Arrange a given vector in ascending order. input = [4 5 1 2 9]; output = [1 2 4 5 9];

meer dan een jaar ago

Solved

Matlab Basics II - Count rows in a matrix
Write a function that returns that number of rows in a vector or matrix x example: x = [1; 2; 3] output = 3

meer dan een jaar ago

Solved

inner product of two vectors
inner product of two vectors

meer dan een jaar ago

Solved

Sum the rows
Sum the rows of the given matrix. Example x = [ 1 2 3 4 ] y = [ 3 7 ]

meer dan een jaar ago

Solved

03 - Matrix Variables 6
Make _fMat_ be a 5x3 matrix of random integers with values from -3 to 3 (Hint: use *randi*)

meer dan een jaar ago

Solved

Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

meer dan een jaar ago

Solved

Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

meer dan een jaar ago

Solved

Reverse a matrix
Its simple. You have to reverse a given matrix.

meer dan een jaar ago

Solved

Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

meer dan een jaar ago

Solved

Melvyn and Banner are fighting over chocolates. Melvyn has X chocolates, while Banner has Y. Whoever has a lesser number of choc...

meer dan een jaar ago

Solved

ascii value
let input='a' output=97

meer dan een jaar ago

Solved

<http://en.wikipedia.org/wiki/Benford%27s_law Benford's Law> states that the distribution of leading digits is not random. This...

meer dan een jaar ago

Solved

Create a matrix with difference of each row of input matrix
With a given input matrix A, create a output matrix B in such a way that each row in B is a difference of rows of input matrix A...

meer dan een jaar ago

Solved

Array of Ones
Create a 100 X 100 array of ones.

meer dan een jaar ago

Solved

Find the position of first minimum value in an integer array with numbers
If x = [2 6 4 9 10 3 1 5 1] the the output should be 7, because the first minimum value (1) lies at the 7th position.

meer dan een jaar ago

Solved

Find the nearest integer
Given a vector of integers and a real number find the closest integer. EX: >> a = [2 4 5 6 8 10]; >> b = 4.6; >> nea...

meer dan een jaar ago

Solved

Complex number
For complex number c=a+bi, write code that will add a and b together.

meer dan een jaar ago

Solved

Positive Infinity
Round the array a towards positive infinity

meer dan een jaar ago

Solved

Matlab Basics II - Create a vector with a repeated entry
Create a row vector of length n, filled with 4's, for example, if n = 3 output = [4 4 4] make sure to round UP when n is a...

meer dan een jaar ago

Solved

Sum the real and imaginary parts of a complex number
Sum the real and imaginary parts of a complex number. Example c = 1+2i has the solution 1 + 2 = 3

meer dan een jaar ago

Solved

Find the position of last minimum value in an integer array with numbers
If x = [2 6 4 9 -10 3 1 5 -10] then the output should be 9, because last minimum value (-10) lies at the 9th position.

meer dan een jaar ago

Solved

Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

meer dan een jaar ago

Solved

Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

meer dan een jaar ago