15 total contributions since 2019

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

7 months ago

Solved

The Answer to Life, the Universe, and Everything

A variation of a previous Hitchhiker's Guide to the Galaxy problem. *Inputs:* Life, the Universe, and Everything *Output:*...

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

7 months ago

Solved

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

7 months ago

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

7 months ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

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

7 months ago

Solved

Make a checkerboard matrix

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

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

7 months ago

Question

Taylor Series of e^x on point 1

Greetings, I am trying to make my own script where I can approximate a function using a Taylor polynomial. However, when I try ...

7 months ago | 1 answer | 0

Question

Is it possible to assign the constant value of a function handle to a variable?

Hello, My program can sometimes generate this function handle: g = @() 1.0 Or generally: g = @() c , c: constant Is it po...

11 months ago | 2 answers | 0

Question

Is there any way to separate the terms of a product?

Hello, Let's say I have this function_handle: f = @(x) exp(x-2)*log(x) Is it possible to assign each function that comprises t...

11 months ago | 1 answer | 0