Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

1 month ago

Solved


Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN; output -> matrix(p*m), the same matrix where we deleted the enti...

1 month ago

Solved


Divide elements by sum of elements
In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the s...

1 month ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

1 month ago

Solved


Is my wife right?
Regardless of input, output the string 'yes'.

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

1 month ago

Solved


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

1 month ago

Solved


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

1 month ago

Solved


Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...

1 month ago

Solved


Create a vector
Create a vector from 0 to n by intervals of 2.

1 month ago

Solved


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

1 month ago

Solved


Find max
Find the maximum value of a given vector or matrix.

1 month ago

Solved


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

1 month ago

Solved


Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

1 month ago

Solved


Convert Fahrenheit to Celsius
Calculate the Celsius temperature C given the Fahrenheit temperature F. Examples: Input F = 90 Output C is 32.22 I...

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

1 month ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

1 month ago

Solved


Inner product of two vectors
Find the inner product of two vectors.

1 month ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

1 month ago

Answered
Sine input for a state space model
Hi, There are several errors in your script: (1) inp_2nd = [0;5*sin.(sqrt(2*k/J).*t7);0]; has to be inp_2nd = [0, 5*sin(sqrt...

2 months ago | 0

Answered
Importing Excel file and reading data
Hi, Here is the simple solution to your problem: D = 'C:\Users\test'; % Directory where all data: Run1.xls, Run2.xls, ......

2 months ago | 1

Answered
how to compare elements in an array respectively
Hi, Here is a short anwer: Max_vs_AB = any(Max>A & Max>B); A_vs_B = any(A>B); if Max_vs_AB ==1 && A_vs_B==1 fprintf('...

2 months ago | 0

Solved


Duplicate a character
Duplicate a character 'n' times. Example 1: str='a' n=5 output='aaaaa' Example 2: str='*' n=3 output='***'

2 months ago

Solved


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

2 months ago

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

2 months ago

Answered
decrease the elapse time
Hi, You'd need to associate all of your calc's into one function file and no need to save all variable/calc values from every...

2 months ago | 0

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.

2 months ago

Solved


Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

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

2 months ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

2 months ago

Load more