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

casi 2 años 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]

casi 2 años 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 = ...

casi 2 años ago

Solved

Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

casi 2 años ago

Question

How to simulate an irradiance of beamlets recombination after emerging from a square aperture, in MATLAB?
I want to simulate (in 3D) the irradiance of several beamlets recombined together after emerging from a square aperture, knowing...

casi 2 años ago | 0 answers | 0

### 0

Solved

Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

casi 2 años ago

Solved

Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

casi 2 años ago

Solved

Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

casi 2 años ago

Solved

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

casi 2 años ago

Solved

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

casi 2 años ago

Question

How to find the exact index(row, col) of a maximum value in a matrix?
I want to find the maximum value in an image, I tried to find its index and I found it after converting the image matrix into a ...

alrededor de 2 años ago | 1 answer | 0

### 1

Question

Cody gives me error for my solution whereas MATLAB run it efficiently
I tried to solve some problem in Cody. I wrote that function and run it in MATLAB and it worked perfectly. While it gives me err...

alrededor de 2 años ago | 0 answers | 0

### 0

Question

I downloaded some functions files with a script file from Mathworks website. Every time I run this script, it tells me that thes...

alrededor de 2 años ago | 2 answers | 0

### 2

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

alrededor de 2 años ago

Solved

Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

alrededor de 2 años ago

Solved

Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...

alrededor de 2 años ago

Solved

Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

alrededor de 2 años 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...

alrededor de 2 años ago

Solved

Return area of square
Side of square=input=a Area=output=b

alrededor de 2 años 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.

alrededor de 2 años ago

Solved

Given a and b, return the sum a+b in c.

alrededor de 2 años ago

Question

Why do we transfer the image into double?
I saw a lot of image processing examples and before conducting any analysis the image is transfered into double. Is it essential...

más de 2 años ago | 2 answers | 0

### 2

Solved

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

más de 2 años 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 ...

más de 2 años 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:...

más de 2 años ago

Question

Why sometimes we place an empty brackets inside function inputs?
I don't know the purpose or the mean of these empty square brakets inside many functions, for instance: min( a, [ ],2) imsho...

más de 2 años ago | 1 answer | 0

### 1

Question

How can I update the x axis limit inside a loop?
% parameters omav = 5*1000*2*pi; % omega average, center sigma = [0,0.5,1,2,5].*1000*2*pi; % std deviation. A.K.A width t...

más de 2 años ago | 1 answer | 0

### 1

Question

How to make a loop to do a specific operation for multiple variables?
lambda = num(:,1); RefInd1 = num(:,2); RefInd2 = num(:,3); RefInd3 = num(:,4); % For the draw ratio DR=1.00 ny1 = int...

más de 2 años ago | 1 answer | 0

### 1

Question

Why polar plot is not circular like this?
I tried to plot data by polarplot function and it keeps looking like this.. However, when I plot these data in some other progr...

más de 2 años ago | 0 answers | 0